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

learn more… | top users | synonyms (1)

6
votes
6answers
698 views

What are the most used pattern to manage a lot of interconnected parameters?

I recently start to work on an application that drive different measurement device. Before the user start a measure, she sets the parameters of it. Actually, considering all measurements type there ...
1
vote
2answers
118 views

Alternatives to using dictionary in parameters in C#?

I have a method that takes in a dictionary and enum value and produces a string output. Enum value defines what template string to insert the dictionary key value pairs into. public string ...
16
votes
2answers
11k views

How would you implement Google Search? [closed]

Supposed you were asked in an interview "How would you implement Google Search?" How would you answer such a question? There might be resources out there that explain how some pieces in Google are ...
3
votes
2answers
292 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 ...
0
votes
2answers
36 views

Flag arguments in an html factory class

I have been told that flag arguments(boolean arguments) are a bad thing because it complicates the signature of the method and means that the method does more than one thing. An issue I have with ...
1
vote
1answer
35 views

Filtering additions to a list

Hopefully Iʼm posting this in the right SX, and Iʼve tagged it correctly. I have a legacy system that Iʼm making additions to which contains a custom list object. This list object can contain two ...
0
votes
0answers
33 views

DDD Request Validation Handling

I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
11
votes
1answer
331 views

Is it good practice to implement two Java 8 default methods in terms of each other?

I'm designing an interface with two related methods, similar to this: public interface ThingComputer { default Thing computeFirstThing() { return computeAllThings().get(0); } ...
3
votes
3answers
183 views

Communication between state machine and GUI

I am writing a finite state machine in C++, designed as a library. Furthermore, I have a GUI implemented as a separate project which needs to update the user interface according to state changes ...
1
vote
2answers
64 views

One method to search and create if not found, or two methods

Lets say i am writing a web app that accesses user accounts in a database. If the account exist use that data. But if the account doesn't exist create a new one. Should this be done with two or one ...
14
votes
6answers
2k views

Loose Coupling in Object Oriented Design

I am trying to learn GRASP and I found this explained (here on page 3) about Low Coupling and I was very surprised when I found this: Consider the method addTrack for an Album class, two possible ...
1
vote
3answers
120 views

Unit testing functions calling other tested functions [duplicate]

I have three functions: ValidateUsername(), which determines if a string is a valid username according to some rules SetUsername() which sets a string as a user's Username if it passes validation ...
3
votes
1answer
153 views

Providing views to an std::container

I want to maintain a buffer of 5 seconds of sensor data. The sensor data consists, among other things, of accelerometer readings in x,y,z dimensions, gyroscope readings in x,y,z dimension and ...
0
votes
0answers
61 views

php - design: database operations

I am working on a control-panel for a VoIP program and I've been working on it for a while. It started off as a small project that I just did because it was fun, but over time I added more and more ...
-2
votes
1answer
37 views

How to design task assignment system?

I want to design a system which is similar with stackoverflow review feature. That is to say: There are n tasks, which should assign to users (users count is unknown). At one time, one task should ...
0
votes
4answers
270 views

How can I avoid the use of strings?

I'm implementing a program where the user can 'create a musical scale' from a variety of notes (identified by their names), and the program will generate music from this scale. I want to implement a ...
11
votes
5answers
2k views

Software Manager who makes developers do Project Management

I'm a software developer working in an embedded systems company. We have a Project Manager, who takes care of the overall project schedule (including electrical, quality, software and manufacturing) ...
2
votes
1answer
76 views

An approach to multilingual db design

My boss is planning on a new db and wants to support multilingual data in this manner: LocalizedDescs (Guid / LanguageGuid being the primary key) Cluster Guid LanguageGuid Desc ProductCategories ...
2
votes
1answer
66 views

Access modifier of abstract class constructors

What access modifier should I use for my constructors in an abstract class, given that the class cannot be instantiated? It seems like the access modifier is superfluous and should be implicitly ...
0
votes
0answers
80 views

Should different projects that share a DB also share data access and other code?

I work on a product that consists of a a single database, and a couple of separate (but related) website projects. The main ones are: public facing site back-office site for our customers to use to ...
1
vote
2answers
42 views

Instantiating a set of Objects from information in File

Let’s say I have four classes A,B,C,D. Each of those classes contains a Tree object. This tree object needs to be built according to information stored in files f_A, f_B, f_C, f_D, for classes ...
4
votes
1answer
75 views

Where to create a file in WPF/MVVM

I'm building a WPF/MVVM application that takes input from the user and generates an output document which it saves in a temporary folder and opens for display in the native application (e.g. MS Word). ...
2
votes
4answers
180 views

Rich object model in the context of a good REST API and of an existing rich object model on the server-side

First off, let's frame this question in the context of a good REST API and an existing rich object model on the server-side, as well as modern web architecture (MVC frameworks like angularjs). I'm ...
4
votes
3answers
453 views

When is an object of real world a (computational) object in OOP world?

In an OOP design phase strategy, Any physical/conceptual object of a system can be modeled(considered) as computational object in your OOP designed program based on below two conditions: First ...
0
votes
0answers
20 views

Which document model to choose in different situations

I needed some custom document format and stumbled on this issue. DocBook does it this way <chapter> <title>Chapter 1</title> <para>Hello world!</para> ...
0
votes
0answers
31 views

Where to generate View?

I plan to build a CRM for small companies. It is supposed to be a single-page application. Now I am unsure where it is more efficient to convert the data to HTML. Should I rather do it on the server ...
0
votes
0answers
43 views

Good architecture with DI where low-level components can interact with another hierarchy details

What would be a good design for accessing low-level components attached to another parent? Assume each User has its own hierarchy and one low-level class wants to send a message to some low-level part ...
2
votes
0answers
122 views

Architecture design for Java servlet that triggers work (for sending push notifications)

I'm designing a push notification server (for pushing notification via APNS and Google servers) and have come up with the following design for a Java based web application server. I would really like ...
5
votes
7answers
3k views

Ways to have a history of changes of database entries

What are ways to allow the versioning of database entries (data)? Think of the content-managment-systems abilities to revert back changes of articles. What are their pros/cons?
0
votes
0answers
52 views

Implementing peristent events using WCF-MSMQ

I am implementing a WCF-MSMQ based message queue that will follow the pub-sub model in which multiple publishers would publish an event and multiple subscriber would listen to it i.e a many to many ...
1
vote
2answers
165 views

Is there a pattern to assist with working around or fixing violations of the Liskov Substitution Principle? [closed]

I've come across a rather large violation of the Liskov Substitution Principle in our codebase. There is an abstract class. Within it is an abstract method, implementers of which are expected to ...
2
votes
1answer
81 views

Best way to organise the software for microcontroller external peripheral drivers

Recently, I have begun designing and writing code for microcontrollers in order to get a deeper understanding of how they work. The first major project I have undertaken involves writing a driver for ...
4
votes
1answer
168 views

OOP design for conditional event processing queue

This will be in C++11, but the object design should be rather agnostic. I have 3 interface classes, IEvent, ICondition, IRunnable. The main loop processes multiple kinds of IEvent, ranging from "an ...
2
votes
1answer
195 views

Events in WCF Service Architecture (Server Side)

Problem: Now, I have some events that will take place when the client submits a request to the server. These events will arise on the server and they will be subscribed by the services themselves ...
21
votes
9answers
3k views

What can go wrong if the Liskov substitution principle is violated?

I was following this highly voted question on possible violation of Liskov Substitution principle. I know what the Liskov Substitution principle is, but what is still not clear in my mind is what ...
0
votes
0answers
32 views

Defensive Programming - “Return” placement [duplicate]

Sometimes I see myself writing code in the following way: if(value == null) return null; //... I will have here as many defensive conditions (and returns) as I need //... Continue to execute method ...
37
votes
6answers
7k views

Hardcoding strings that will never change

So, in my efforts to write a program to conjugate verbs (algorithmically, not through a dataset) for French, I've come across a slight problem. The algorithm to conjugate the verbs is actually fairly ...
0
votes
0answers
24 views

Dealing with stale data / currency issues when lazy loading related entities

Imagine I have two associated domain entities with a one-to-many relationship. Here is an example with Customer and Order classes: public class Customer { public int ID { get; internal set; } ...
27
votes
10answers
6k views

What is good (neat) architecture in programming a simple website, e.g. a contact book?

When I build a simple website, e.g. a contact book where I can add, delete and update contacts, I create an index.php file where a user, if he's not logged in, is requested to enter a password and if ...
3
votes
1answer
90 views

Business concept design vs logical database design

Good day. I need help for a specific case. A little background: We have an existing app, it is like a PDF viewer, and you can draw freehand, highlight, add highlight with notes, add action items, etc. ...
6
votes
5answers
1k views

Why doesn't Haskell have a 'format' function for string interpolation?

I'm trying to use Shake and I stumbled upon the following problem: there's no easy and convenient way to interpolate a string. I know about Text.Printf — it's not what I'm looking for. The ...
1
vote
1answer
83 views

AngularJS Different Controller per Role?

I am creating an AngularJS app with a restful-back end. I have 4 types of users for which each component/page may have significantly differnt behavior. What is the best approach to implement this? Do ...
25
votes
12answers
2k views

How large is ok for a Class?

I’m a long time developer (I’m 49) but rather new to object oriented development. I’ve been reading about OO since Bertrand Meyer’s Eiffel, but have done really little OO programming. The point is ...
0
votes
2answers
67 views

What are some (best) practices of organizing configuration data for applications? [duplicate]

I am working on an application (in php) that needs some rules to evaluate the labelling of some data. Since these rules might change someday, I decided not to hardcode them, rather handle them as ...
0
votes
2answers
128 views

What kind of design diagram is this?

Here is a kata for the Bowling Game problem. Slide 9 (below) shows a design diagram. But its not obvious to me which box is a class and which is a property or method from the makeup of the boxes ...
3
votes
1answer
255 views

Domain Driven Design - designing Aggregate Roots

Imagine you're designing an application for organizing Workshops. Workshop itself is quite complicated - it acts as a state machine with multiple possible states and transitions between them. We're ...
1
vote
3answers
96 views

Dependency inversion without static methods?

It's clear that the dependency inversion principle and the use of interfaces makes software components less coupled and promotes maintainability. On the other hand, these principles make using static ...
5
votes
3answers
168 views

Design Pattern - DLL per Strategy

I usually found myself designing my application in the following way: One DLL containing interfaces for a desired subsystem. For example, Company.Framework.Persistence.dll. One new DLL per each ...
2
votes
1answer
67 views

How to handle overlapping classes

I'm putting together a program to try and recreate a board game. My goal was to keep the rules and actually actions of the game separate from its presentation, so I am creating a library that contains ...
0
votes
0answers
89 views

How do I model this Shipping Routes scenario?

Trying to begin coding this solution. I have a scenario as follows below: A shipping operator has a network of routes to various ports, the routes are specified explicitly below Buenos ...