Questions about problem solving and planning for a solution through software design.

learn more… | top users | synonyms (1)

12
votes
5answers
2k views

Algorithm for percentage without knowing total number

Suppose there are n lines for a hotline. Whenever a customer calls the hotline, the call is forwarded to one of the n lines. And I want to assign percentage of calling to each of the n lines. ...
5
votes
1answer
130 views

Economics of scaling, denormalizing NoSQL for personalized content [closed]

I am using Cassandra for a data intensive app. With relatively little operations and deployment experience, the expertise I am looking for is someone that can read the example below and decide whether ...
0
votes
1answer
44 views

Naming conventions for hierarchical roles in an application [closed]

I'm creating an application that internally will have have three totally different separated areas of interfaces. - One where users create content and interact with each other - One where one person ...
10
votes
6answers
4k views

Are There Any Programming Focused Notebooks? [closed]

I know that engineering paper exists, but are there any companies that make programmer-specific notebooks for notes/pseudo-code/designs? Paper is my preferred way of outlining things, so the addition ...
0
votes
4answers
77 views

Public and Private Constructors with Equivalent Signatures

Here is the problem illustrated using an example of an immutable class. A Book must have at least one of a title and an ISBN. public class Book { private readonly string _title; private ...
4
votes
2answers
300 views

Design interface for WebService to access several MySQL databases

I am currently trying to design an interface for a WebService that can access several MySQL databases. There will be 4 operations available, Add(), Read(), Update() and Delete(). The WebService just ...
21
votes
2answers
1k views

Who should read Exception.Message if at all?

When designing exceptions should I write messages that a user or a developer should understand? Who should actually be the reader of exception messages? I find exception messages aren't useful at all ...
4
votes
2answers
354 views

What is NOT MVC? (in a web app)

It is easy to find many descriptions of what MVC is - for instance here, here or in this video. I'm curious, what is NOT MVC? or more precisely - In a MVC-using app, what is everything else apart ...
3
votes
1answer
125 views

What Lisp data structure to use?

I am studying different language games and trying to implement them in Common Lisp. Currently, I am studying a game which studies the relation between forms and meanings. An agent needs to store the ...
2
votes
2answers
290 views

Why do some prominent web sites use alphanumeric strings for resource IDs instead of numbers?

For example, the video IDs that YouTube uses are not a simple number, but instead a case-sensitive, alphanumeric string (like dQw4w9WgXcQ). Why do some websites, such as YouTube and Dailymotion use an ...
5
votes
3answers
175 views

How to reconcile “not mocking what you don't own” with “expectations” in unit tests?

I'm putting together a set of models for use in a Zend Framework 2 application. So, each model has a table class which acts as the interface between the model and database for querying. Using the ZF2 ...
0
votes
0answers
64 views

generic inventory system that can be used by many types of inventory systems

I would like to write code that can be used for inventory control. The initial requirement is simple, but I would like to write it generic, in case the requirements expand, the code be ready for it. ...
2
votes
1answer
218 views

How to avoid tying these two methods together with global mutable state?

I'm in the process of reading Code Complete 2 and learned that using global state is a no-no. What can I do to avoid using global state in this situation? Some background information: I have two ...
3
votes
2answers
502 views

How to avoid calling String.Replace() in a loop?

I am building a very simple email templating system in C#, and it works amazingly, but I have a personal issue with the way I designed it: Template looks like this: Hello {UserName}, Welcome to ...
1
vote
3answers
263 views

Use of electronics in programming [closed]

Does a programmer need to have a deep understanding of digital electronics. Theoretical v/s practical. As what they teach us at college is pretty basic? If yes, then do all kinds of programmers ...
3
votes
2answers
136 views

Better To Call In Dive Into Submethods Or Pass Around a result

I have a service that does fairly complicated business logic when it receives a request. I have most the functionality isolated into private methods which dive a couple levels down from the method ...
4
votes
2answers
149 views

Exposing nodes in a generic binary search tree implementation to visitor pattern

It's common to implement binary search trees with an internal Node class public class BinarySearchTree<TKey, TVal> { class Node { public readonly TKey Key; public ...
1
vote
0answers
124 views

MVVM viewmodel to view correlation in adaptive UI

I am making an mvvm application for the uwp platform and I am looking for advice on the following matter. Take for example the windows 10 e-mail application, which when full screen displays both the ...
2
votes
1answer
69 views

Modeling resources with links

Context To be fully compliant with the REST principles enumerate in Fielding's dissertation, a resource must contains links that redirect to other resources that have a relation with it functionally, ...
1
vote
1answer
60 views

OO Design: Reading/Writing object with multiple formats

I have a class Song, which has the following public methods: String getSong(); void setSong(String); int getId(); void setId(int); Now I have two different ways I might want to store these songs in ...
3
votes
5answers
1k views

Why is an interface in Java not allowed to have state?

There must be a good reason why Java designers didn't allow any state to be defined in interfaces . Can you please throw some light on this aspect of design decision ?
2
votes
1answer
148 views

Common Repository design

What I have: I am developing an Active Directory layer which will be used by a huge application with several modules having several solutions and projects... I am fairly new to developing large ...
16
votes
4answers
2k views

What is the limit to the number of a class methods?

In different design books that I read, sometimes big emphasis is put on the number of methods that a class must have (considering an OO language, as java or C# for instance). Often the examples ...
0
votes
1answer
121 views

TDD - Outside In developemnt

I'm pretty comfortable with the core concepts of Outside In (especially from this question). However one thing eludes me concerning the mocks you created at each level which then lead to creating the ...
31
votes
11answers
3k views

Well designed / high-quality open source software [closed]

I'm taking a software design class where I should choose an open source software to analyze from the Software Design point of view. It has to be a big project: not less then 100,000 lines of code. I ...
2
votes
2answers
169 views

Merging two applications into one

Background: My bosses want to merge two application that have two separate purposes. One being for monitoring of equipment and bandwidth for our internal network operations. The other is an ...
2
votes
3answers
407 views

Is `isNaN`' a bad design or a has-to-be design with tradeoffs?

My first programming language is python. And recently I'm learning C and javascript. In javascript, there is a design which confused me a lot, default the function isNaN. Put aside its weird ...
62
votes
15answers
25k views

What is the ideal length of a method? [closed]

In object-oriented programming, there is no exact rule on the maximum length of a method , but I still found these two qutes somewhat contradicting each other, so I would like to hear what you think. ...
0
votes
1answer
89 views

Function or class design in library API for efficient object reuse

I am currently building a library in C++11, where I spent a lot of time trying to design a good interface. After some small redesigns along the way, I've ended up with a design that I am happy with. ...
1
vote
3answers
82 views

Inheritance or type field when designing class

I have to model a store with all kinds of articles. The user has to be able to filter these articles by type, price, ... . The store would contain a list of Article objects. I've been stuck on ...
29
votes
7answers
3k views

Are classes with only a single (public) method a problem?

I am currently working on a software project that performs compression and indexing on video surveillance footage. The compression works by splitting background and foreground objects, then saving the ...
0
votes
0answers
87 views

How to improve the design pattern of this Screen Window system?

I have a Screen Window system, a Screen (IScreen as interface), which holds a window, either WindowA or WindowB. System can switch window by calling stateChanged: class IScreen{ public: virtual ...
2
votes
2answers
69 views

Design architecture advice on relation between objects and singleton JS

I would like your feedback regarding some best practices on design relationship between objects, specially when a singleton object is involved. Let's imagine I need to simulate a Shop with ...
2
votes
2answers
102 views

Designing voucher system in e-commerce application

I'm currently designing voucher system to be implemented in our company e-commerce application. I'm currently have voucher table in database which contains following information : Unique voucher ...
0
votes
1answer
84 views

Where is the appropriate place to put application configuration files for each popular operating system? [duplicate]

Before writing this question, I'd like to state that I use Linux on a daily basis, which is why I'm creating this post to extend my knowledge of the other main operating systems I'm concerned about, ...
7
votes
2answers
2k views

how to refactor many singletons

I have a medium-sized python program (~5000 lines of code), which I've built up over time, with no particular plan as I went ahead. The architecture I've ended up with consists of 5-6 large Singleton ...
1
vote
1answer
342 views

MVVM with multiple view models that share a model

I have an application where there is an "inventor" model whose data I would like to display differently in different areas of the application. Therefore, I'd like to create different view models ...
0
votes
2answers
277 views

Does algorithm design belong to software engineering? [closed]

In academic meaning, it seems to me that algorithm design is studied in a high/abstract level of computation (computability, complexity), although software engineering is also studied in ...
8
votes
1answer
319 views

Are Windows 10 app services only useful in enterprise environments?

I have been following one of the capabilities Microsoft introduced for the Universal Windows Platform (UWP), namely app services. An app can now provide a service in the form of a background task that ...
2
votes
3answers
161 views

HasMany RESTfull Implementation

So I've been reading a lot on RESTfull design - specifically dealing with resources. Taking the canonical example of Users, Posts, and Comments, with relationships as: Users ---(hasMany)---> Post ...
15
votes
5answers
7k views

What to plan before starting development on a project? [closed]

Say I've received the specifications for a project from a client, and now its time to start developing it. Normally, I just start with the first module (usually user registration) and then go from one ...
4
votes
2answers
381 views

Is this a pattern? Proxy/delegation of interface to existing concrete implementation

I occasionally write code like this when I want to replace small parts of an existing implementation: public interface IFoo { void Bar(); } public class Foo : IFoo { public void Bar() { ...
5
votes
8answers
299 views

Designing around shallow constness with inheritance

Background I'm writing an image handling class. For this question two requirements of the class are of interest: Must have "deep" const correctness. Must allow sub-image aliases, a.k.a. sections or ...
0
votes
0answers
18 views

How to organize enterprise software in Git [duplicate]

I'm running into a conceptual design dilemma with our enterprise software. I'm hoping someone on here can help point me in the right direction. We have many different applications: Three Windows ...
0
votes
2answers
91 views

Should public API classes have helper methods that provide anticipated functionality?

For the purposes of providing a concrete example for my question, let's say I'm building an API that provides access to an email system and contains a set of public classes e.g. Mailbox, ...
0
votes
1answer
53 views

How to write loosely coupled tests [duplicate]

I work on a software that has a lot of tests. However, instead of helping us develop faster, these tests actually bog us down, because even tiny changes in the application break many tests. Clearly, ...
3
votes
1answer
108 views

How to write a simplistic functional test plan?

I was given an assignment and it is fairly simple, just a special type of search for a special type of objects. However, I was told to implement a set of functional tests and also provide a 1 page ...
10
votes
3answers
477 views

How do you conquer the challenge of designing for large screen real-estate? [closed]

This question is a bit more subjective, but I'm hoping to get some new perspective. I'm so used to designing for a certain screen size (typically 1024x768) that I find that size to not be a problem. ...
2
votes
1answer
191 views

How do you calculate affinity in Edge Rank/Activity Streams

I have been researching how to build a newsfeed that sorts the order by relevancy. I have been following along Facebook's Edge Rank and Etsy's Activity Feed Architecture and I can't figure out how ...
1
vote
0answers
108 views

ASP.Net MVC - Implementing a Test Environment

I would like to implement some sort of test environment for ASP.Net projects. I am trying to implement this as an alternative to mocking the entity framework. Here is what I am trying to achieve : ...