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

learn more… | top users | synonyms (1)

2
votes
4answers
293 views

what is the difference between overengineering, underengineering and rightengineering? [on hold]

What is the difference between over-engineering, under-engineering and right-engineering at coding/design perspective? I found over-engineering: Coding too much like doing future requirement code ...
3
votes
2answers
169 views

Storing session key in a hidden field

Background: I have a question which is outline at Use different local storage between windows. The very high level question is "How can I keep tabs and windows sessions from clashing". Requirement: ...
1
vote
0answers
54 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 ...
1
vote
1answer
92 views

Design Pattern - Adding features to a class

I'm finding myself unable to solve a design problem. For the sake of my simplicity, I'm going to use C# (Web API). Let's say I have an abstract class RestController: public abstract class ...
1
vote
2answers
114 views

Should constructors for API classes ever be public, or can a factory always be used? [on hold]

I'm surprised this doesn't seem to have been asked before, or at least I can't find it anywhere. I know this is more of a philosophical question, but is there any particular reason not to use a ...
0
votes
0answers
59 views

Pattern to share fields in inheritance

I'm trying to figure out the best way to solve a design issue. I have to be able to clone (I'm cloning them to Apache HttpClient) different types of HttpServletRequest (POST, GET...) and then send ...
1
vote
2answers
96 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 ...
0
votes
0answers
22 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? ...
1
vote
1answer
33 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 ...
3
votes
2answers
277 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
35 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 ...
0
votes
1answer
89 views

Designing advanced n-body physics that lead to a stable state [on hold]

I'm currently organizing a map with a physics engine that implements a realtime n-body simulation with (somewhat) elastic links. The forces also decrease over time. I've extended it to also work with ...
1
vote
2answers
57 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 ...
3
votes
3answers
158 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 ...
4
votes
0answers
124 views

Does REST is only limited to optimistic concurrency control?

Context Due to the statelessness of the REST architectural style involving that each requests stands completely alone, leading server to never store any informations about client. Thus, pessimistic ...
1
vote
3answers
101 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 ...
0
votes
1answer
65 views

Testable design in Swift

I've been searching for so long about how to design testable classes in Swift but every information site just describe basic stuff like how to test, how to assert, why is testing good... My current ...
0
votes
0answers
58 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
23 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
1answer
47 views

Efficient way to handle foreign keys

I am building a script that checks a large network of sites for invalid links. The idea is to flag links that continuously show as not available so that they can be cleaned by the administration team. ...
0
votes
4answers
249 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 ...
3
votes
1answer
147 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 ...
2
votes
1answer
54 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 ...
10
votes
1answer
288 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); } ...
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 ...
2
votes
1answer
68 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 ...
0
votes
0answers
76 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 ...
0
votes
2answers
194 views

Cost estimation in software engineering

I was asked by my Boss to do a cost estimation for a specific iOS project. Well I have several years of development experience , but I never had to do a cost estimation. What I did so far: iOS I ...
4
votes
1answer
60 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). ...
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
38 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
73 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 ...
6
votes
6answers
682 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 ...
0
votes
0answers
41 views

Best practices for creating a project utilities module? [migrated]

Does anyone know of any best practices around creating a utilities module or class specific to your project? I have a project I've been working on that has three different moving pieces, but we keep ...
-3
votes
0answers
40 views

For Review: My UML Structure for a PHP PDF Invoice Module

I like to develope a simple PDF Invoice Module on PHP5. It s important for me to provide a good design and code structure. For that, I made the following UML: http://postimg.org/image/yzxandd0p/ The ...
0
votes
0answers
37 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 ...
0
votes
0answers
31 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 ...
1
vote
2answers
159 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 ...
0
votes
0answers
23 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; } ...
3
votes
1answer
87 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. ...
4
votes
1answer
164 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 ...
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 ...
2
votes
1answer
78 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 ...
0
votes
2answers
62 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
117 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 ...
2
votes
1answer
166 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 ...
1
vote
3answers
89 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 ...
2
votes
1answer
65 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 ...
5
votes
3answers
151 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 ...