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

learn more… | top users | synonyms (1)

3
votes
3answers
1k views

Domain driven design, can two aggregates have the same root?

For the purpose of separating different functionality into different classes, I have two following Aggregates: ActiveEmployee AssignTask () ReassignManager () Deactivate (string reason) ...
1
vote
1answer
100 views

Compiler design prevent register override

I'm trying to write a compiler for a self-designed CPU with accompanying instruction set. The CPU has 3 registers, 2 input registers (B and C) and one output register (D). When for example an ADD ...
1
vote
0answers
32 views

Feedback on simple authorisation system design

I'm writing a fairly simple authentication/authorisation api for an intranet application we are developing. It's my first roles based authorisation system and its a good opportunity for a first ...
1
vote
1answer
61 views

AGPL affects layout/design?

I've read many times AGPL3 (http://www.gnu.org/licenses/agpl-3.0.html) but I have a question, maybe somebody with a deeper knowledge can clarify me something. I would like to use a source code which ...
0
votes
0answers
102 views

Advice on program performance after changes

So, the situation is like this: For the past two years, I have implemented a class in c# which is used to filter different fields from different tables in database (SQL), for reporting purposes. Now ...
1
vote
3answers
119 views

Is a TCP client/server a good solution for a system which can be controlled by a GUI running on multiple platforms?

Consider a software which runs on a dedicated system (basically a Linux box), and controls some machinery. The system has all the required hardware interfaces for the task. The software also has a GUI ...
0
votes
0answers
27 views

Design solution for currentUser object behavior in the SDK

Background Our team working on the SDK to give third-parties access to our service. The basic functional is moving around the current logged-in user. Basically we have a User class with static ...
4
votes
2answers
234 views

Having an discussion about security concerns with another software engineer [closed]

Background: The company I work for uses different systems to hold their insurance data which is customer related. They want to have an app for their customers where they can find their insurance ...
3
votes
1answer
127 views

When should feature rebranding be followed by model and code renaming? [closed]

In a product we are rebranding a feature. For example, we have tweets and we are rebranding it to news. On the code side we have tables and structures like tweet, user_tweets, favourite_tweets and so ...
12
votes
3answers
433 views

Is it better to guard the method call or the method itself?

I am writing an application and I got to this point: private void SomeMethod() { if (Settings.GiveApples) { GiveApples(); } if (Settings.GiveBananas) { ...
6
votes
3answers
367 views

When testing is it OK to use a method of the subject to test another method of the subject?

I have two methods in the same helper class one that creates an image (createImage) and one that compares two images (compareImages). Image createImage(Data data); Boolean compareImages(Image from, ...
0
votes
0answers
40 views

How to get dual UI for an ionic app?

I would like to get some suggestions for building a new app. This app has two faces/UI to it, buyer/seller. Users would have same account, and it would be seller and buyer. Its something similar to ...
3
votes
0answers
117 views

Log with Application Insights only (NLog vs AI) in Asp MVC

I was going through several blog posts and stackoverflow and programmers and I am still a bit confused. You can install NLog (or some other logging lib) and start logging quite fast and then you can ...
0
votes
2answers
184 views

Efficient Repeating Alarm Clock in Low Level Language like C

I was thinking about it and I was curious as to how one would code an efficient repeating alarm clock in C? Would you set an alarm time and then offset the time with the ms time equivalent of a day ...
2
votes
1answer
109 views

Does it make sense to have a user specified thread limit?

I'm developing a C++14 application and would like to take advantage of the new multithreading features, in particular std::async. I have seen a number of applications which allow the user to specify ...
2
votes
4answers
228 views

Handling Multiple Collections in C#

I'm currently trying to learn C# and want to enhance my understanding of Object Oriented Programming (OOP). I'm hoping to accomplish this by experimenting with a small program that keeps track of my ...
1
vote
2answers
256 views

Design consideration on JSON schema for an API

I have an API endpoint that retrieve data from 3 SQL tables on the server-side. At the moment, I do a SELECT with joins, consolidate/reorganize the selected data based on a JSON schema, and then send ...
3
votes
4answers
239 views

Is there a reason for support multiple different releases?

I have a discussion with my team recently and I heard a suggestion for deploying multiple releases. Such as version (newest) and version (old). But I am thinking what would be the reason for customer ...
5
votes
5answers
339 views

Is smarter software necessarily bigger? [closed]

This is kind of a vague question so I apologize in advance. When software is "smarter", I tend to interpret that as really just saying that it covers more edge cases. First of all, is this correct? ...
1
vote
0answers
53 views

Universal Modules GUI Design

PROBLEM: GUI built above database entities usually consist of creator window (pane etc.), editor window, maybe grid or other view window. To represent an entity for user it usually requires building ...
2
votes
3answers
145 views

How can I store incomplete records but enforce data correctness?

I'm in the planning/design stages of a new project, and I'm having trouble coming up with a good way to handle one of the requirements: Users must be able to create a new record and save it as ...
0
votes
2answers
976 views

Ways for a young programmer to not feel intimidated at my first REAL programming job? [duplicate]

I'd like to state first that I'm a 19 year old programmer living in Portugal, and have recently started my first REAL programming job. I say "REAL" because at my previous jobs, I was normally the ...
6
votes
1answer
167 views

Software design: recommend approach to avoid slicing/type erasure here

Here is a concrete minimal example to formulate my question : In small ball game, you have a physics engine that moves the objects regularly: void move(set< PhysicalObject* > objets, Duration ...
9
votes
4answers
672 views

Why do python generators and functions share the “def” keyword?

Consider the following: def some_function(): return 1 def some_generator(): yield 1 In the code above, some_function is a function, while some_generator is a generator. They look quite ...
3
votes
3answers
137 views

How do you test a selenium framework?

I have a very large selenium test framework I use to test a web application. It it built around a page-object pattern. This week I fixed a bug in a low level piece of the framework, but it broke many ...
120
votes
5answers
8k views

What are good habits for designing command line arguments?

While developing the application I started to wonder - How should I design command line arguments? A lot of programs are using formula like this -argument value or /argument value. Solution which ...
0
votes
1answer
55 views

Packages : opposing forces of reusability and developability

In choosing the classes to group together into packages, we must consider the opposing forces involved in reusability and developability. Balancing these forces with the needs of the ...
6
votes
3answers
196 views

System Decoupled in the Wrong Places: Meta-Problem? [closed]

At a meta level, I often find that when I grow a codebase organically, parts of the system that I eventually find need to know about each other (at least through some interface) have been mercilessly ...
3
votes
3answers
243 views

Single Responsibility - is this class doing too much?

I'm redesigning one of my programs which performs certain actions on processes of interest (known as "Monitored Processes" in my program). Some actions I always need to do on those processes are: ...
9
votes
1answer
322 views

Enum with a lot of boolean properties

I'm currently working on a webapp where we often need to condition some server logic based on the page that is going to be returned to the user. Each page is given a 4-letter page code, and these ...
4
votes
10answers
1k views

Standardized Data Structure Interface

I want to work with a variety of data structures (arrays, singly/doubly linked lists, sorted structures, etc.) on a plug-and-play basis. For example, I want to be able to easily swap in and out the ...
1
vote
2answers
146 views

Parameterization vs subclassing

Example taken from : Agile software development : principles, patterns and practices A new employee is added by the receipt of an AddEmp transaction. This transaction contains the employee's name, ...
2
votes
2answers
139 views

How unit test service method that use repository method

For service methods that call repository methods to interact with database how could I unit test these service methods? For example, public function updateSlideshow($data){ // do some logic ...
1
vote
1answer
148 views

Making more than one instance of factory that is supposed to be singleton

However, there are some classes that should have only one instance. Sometimes they are factories, which you can use to create the other objects in the system. If more than one factory ...
2
votes
3answers
221 views

C++ Virtual destructors used only when there are virtual functions

This is from Effective C++ (Meyers): Classes not designed to be base classes or not designed to be used polymorphically should not declare virtual destructors I don't understand why ...
7
votes
1answer
301 views

Best design to create dynamic set of questions(controls ) in silverlight web application?

I have around 15 templates (this will grow) and each template will have around 10-15 questions. Each question can have answers in different format like text box, list box, dropdown, radio button etc. ...
3
votes
2answers
97 views

Is it a bad idea to put externally dependent logic in ORM classes?

Case in point in Entity Framework, but this is a design question which has applicability to any ORM. In the current application we have a couple of ORM data classes which do stuff not directly ...
6
votes
3answers
301 views

Alternative to Anemic domain objects (Simple example provided)

I want to model (TV)Events and Reminders and I’m wondering what’s ‘the best’ way to model this. The requirements are roughly When an Event has no Reminder, a Reminder can be created When an Event ...
26
votes
10answers
3k views

Given a herd of horses, how do I find the average horn length of all unicorns?

The question above is an abstract example of a common problem I encounter in legacy code, or more accurately, problems resulting from previous attempts at solving this problem. I can think of at ...
3
votes
2answers
426 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 ...
9
votes
2answers
471 views

Interface Segregation Principle: What to do if interfaces have significant overlap?

From Agile Software Development, Principles, Patterns, and Practices: Pearson New International Edition: Sometimes, the methods invoked by different groups of clients will overlap. If the overlap ...
1
vote
1answer
80 views

Personal pages domains architecture

We're looking to add personal pages generator for our users, which is simple enough while all of them are on our domain. We also want to enable them to purchase their own domains through us, and serve ...
24
votes
6answers
3k views

Is there a design pattern to remove the need to check for flags?

I'm going to save some string payload in the database. I have two global configurations: encryption compression These can be enabled or disabled using the configuration in a way that either only ...
8
votes
2answers
235 views

Do we need to validate entire module usage or just arguments of public methods?

I've heard that it is recommended to validate arguments of public methods: Should one check for null if he does not expect null? Should a method validate its parameters? MSDN - CA1062: Validate ...
9
votes
2answers
198 views

Programming to Data Oriented Interfaces

There is a portion of our codebase written in the following style: // IScheduledTask.cs public interface IScheduledTask { string TaskName { get; set; } int TaskPriority { get; set; } ...
4
votes
1answer
84 views

How does an product order payment works during a race condition?

This is a pretty generalized question which I am asking. Scenario 1 I have a product 'Pen' which has a quantity of 1. Now 2 users a and b has come to buy the product.User 'a' clicked on buy now and ...
6
votes
3answers
734 views

How to solve circular dependency?

I have three classes that are circular dependant to each other: TestExecuter execute requests of TestScenario and save a report file using ReportGenerator class. So: TestExecuter depends on ...
2
votes
2answers
591 views

Entity Component System Coupling

Lately I've been working on a small personal project which is basically an Entity Component System framework with autoupdated Systems. While I have a pretty good idea on the way the framework should ...
6
votes
2answers
294 views

Handling interface segregation in C++

I'm designing a "view" handling system for a game. The goal is to be able to have different "views" that can be shown in sequence or stacked on-top of each other. For example, the initial splash ...
18
votes
9answers
2k views

Good design: How much hackyness is acceptable? [duplicate]

Possible Duplicate: Prototyping vs. Clean Code at the early stages I'm right in front of a difficult decision. I have a problem in my codebase (it's in C++), which I could solve in two ...