Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [design]

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

-3
votes
1answer
130 views

When designing a web application with Vue.js and ASP.NET Core, is ASP.NET solely for the API?

When creating a web application from scratch with ASP.NET MVC Core (using Visual Studio 2017) and using Vue.js, is the MVC Core part of the application solely for the API? What other function would ...
2
votes
3answers
80 views

Is a setter with the composed object as a parameter better or separate setters for each parameter within the composed object?

I have two ideas on how to proceed with an availability class but I'm not sure which one is better. public class TimeRange { private Timestamp startTime; private Timestamp endTime; public TimeRange()...
3
votes
2answers
86 views

How thoroughly should you document business flows for a product or system you are learning?

I work on applications that have user documentation but it is not organized or updated to the current release. Is it worth my time to create my own documentation with screenshots and notes on all the ...
1
vote
1answer
36 views

(Fuzzy) Data duplication detection - scoring systems strategy

Many systems that store data in a structured manner (although this is marked language agnostic, the origin of this question is an MS SQL database) struggle with duplicates. Taking a physical person/...
3
votes
2answers
132 views

Combining composite, decorator and visitor patterns

I am currently working on a project where I need to manipulate a tree-like data structure, which I implemented with a composite pattern. I want to be able to do different actions on this data ...
7
votes
4answers
228 views

Improved design for a turn-based multiplayer game using AI?

I'm trying to decide which is the best architecture for a turn-based multiplayer game where the players can be either humans or AI and the UI is optional, for instance because the game can just be ...
1
vote
1answer
65 views

Too strong of coupling between aggregate roots?

In an effort to save this question, I have re-written it. The original question was regarding how to associate aggregate roots. I have re-factored the code slightly but believe this may couple the ...
0
votes
1answer
57 views

Is it better to initialize semaphores in shared memory or give them as command line arguments? (C++)

I am on a project for which I have to spawn many different processes, all in different executables, and there will be some shared memory segments and some semaphores to synchronize them. I use an "...
-1
votes
1answer
80 views

Would I need a web framework if the app is running locally and not in the net?

I need to make an Employee Payroll application and the client specifically stated that the application will run on their computer locally and will not be hosted anywhere in the internet. I can code ...
2
votes
3answers
278 views

How correct this little game design without removing its design pattern?

Given is a design of a video game in which a player has several possibilities to adjust his character: Game designers realized it's senseless to be a fire-elemental and water-elemental at the same ...
2
votes
1answer
74 views

Is it common for seemingly small feature additions to involve changing many functions?

I wrote a binary calculator & binary teaching program in the Rust programming language. I was taking an iterative approach in that I decided to first get a basic "learn binary" game started. This ...
2
votes
1answer
62 views

How to restore to the correct state when the running process may get shut down thus missing some events?

Here are the requirements: (not the real case, just very simplied version) There is some sort of promotion which lasts for a week. The selected users who may benefit from the promotion is fixed at ...
1
vote
1answer
107 views

Are formal Product Specifications still relevant? [closed]

I had a conversation with a recruiter recently. As a contract engineer, I've worked several jobs over the years and it's been ages since I saw a formal specification. Confluence pages, yes. Jira ...
0
votes
1answer
65 views

Making execution of Python script fool-proof beyond adding shebang

Assume that a Python package (available via PyPI) is too difficult for novice users to utilize. Specifically, typing python2 path_to_package/start_GUI.py in the command line, which opens a TKinter GUI,...
1
vote
1answer
80 views

“State” pattern and encapsulation

Suppose we have the following classes: As you see, it's an implementation of the State Pattern. Basically, the Order class proxies the pay() and cancel() method calls to it's concrete OrderState ...
1
vote
1answer
123 views

Java Class Design

I need to send a json response. I use the jackson library to convert the class to json. I have a core java class to which I need to add some more fields to create my json response. I came with two ...
0
votes
1answer
32 views

CQRS across bounded contexts to generate reports with possible business logic

Where do you draw the line for how much logic can go in your read models? For example, we have 2 BCs: Inventory and Sales. We need to generate reports regarding inventory levels on specific dates: ...
133
votes
17answers
12k views

How do I know how reusable my methods should be? [closed]

I am minding my own business at home and my wife comes to me and says Honey.. Can you print all the Day Light Savings around the world for 2018 in the console? I need to check something. And I am ...
2
votes
2answers
88 views

A good way to represent an object with multiple interconnected states?

I want to program a simple budget application. In my application, the budget is divided into budget periods (months by default, but it can be bi-weekly or weekly periods). In each period there is a ...
0
votes
1answer
127 views

Firmware Design Document (FDD) for an embedded system

What is a firmware design document (FDD) in terms of an embedded system? I am working on developing an application that would be working on a customised board similar to the Xilinx Zynq Development ...
0
votes
1answer
112 views

In MVC + SOA Architecture, What is the Rationale for Placing Business Logic in Models?

When writing web applications I place business logic in controllers. This has worked well for my small App Dev team- our applications run reliably, perform well, and the code is easy to maintain. ...
8
votes
2answers
159 views

fall-through switch for executing a sequence of steps

My program needs to execute a sequence of steps from start to end. But based on different input the start point will vary, e.g, some will run from the first step to end, some will run from the 2nd ...
-2
votes
3answers
167 views

Choosing between the lesser of two evils — bad design?

I have two classes, Bar and Baz. Both subclass the abstract class Foo which has a method doThing(). Bar implements a functional interface Now which contains method doThingNow() whereas Baz implements ...
1
vote
3answers
115 views

subclass with no logic of abstract class

I have a class named Change which should be abstract and have some basic methods. I have classes Insert, Update and Delete that extends Change. In the case of Insert, Update I just use extend and add ...
-3
votes
3answers
141 views

Is storing configurations in memory more performance and maintenance efficient? [closed]

My teammate has this class which contains a lot of Strings: public class Config { /** * List of status */ public static final String IN = "bla*"; public static final String ...
1
vote
1answer
160 views

Using generics on interfaces when implementation is not generic

Is it acceptable practice to put generics on an interface when the implementation will not be generic? Lets say that my project will have many classes that read data from the database. I may make a ...
2
votes
5answers
234 views

Design pattern for creating object hidden from client

I am having difficulty understanding which design pattern would be best for the following scenario. An application uses a database. That database can either be the production version (SQL) or a test ...
3
votes
3answers
152 views

Factory pattern or builder pattern ? which one is suited for reading Finite Element Model data from a text file?

A follow up to another question (Making a design decision about reading model data from an input file). I wish to ask another question regarding builder or factory pattern. (I read that builder is ...
2
votes
1answer
91 views

Making a design decision about reading model data from an input file

I am writing a finite element software in C++ and Qt. I want to load the input data to the model. I have a Model class that holds the data and does the work. I have created a simple lexer and parser ...
2
votes
1answer
166 views

What are the pros and cons of keeping most of an application's state in a single struct?

In my application, I have a few classes. Many of these classes share common state like a reference to the logger for example. For example, both A and B require some common state to get their job done. ...
-1
votes
1answer
106 views

How to ensure separation and inward dependencies between architectural layers in Python?

Suppose a large-scale project is being developed in Python 3.7. Some layered architecture is chosen: "clean architecture", "onion" or "hexagonal". The Dependency rule in it only allows inward-...
2
votes
2answers
85 views

Where to implement method to make a logical copy of an object

I am busy developing code that processes a bunch of objects that represent monthly reports for regions (e.g. one instance per region per month). Let's call them RegionMonthlyReport objects. At the end ...
0
votes
1answer
58 views

Circular dependency exists logically or physically and can be it broken with IDs?

So ran into an issue with circular dependency that looked like this: public class A { public List<B> Bs { get; private set;} public void AddB(B b) { Bs.Add(b); } ...
3
votes
2answers
357 views

C++ Gof Design Patterns heavily depends on new or shared_ptr

I'm trying to learn the best practices for code design and reuse in C++ so I am going through the well known GoF Design Patterns Elements of Reusable Object-Oriented Software. I noticed that nearly ...
2
votes
4answers
202 views

Inheritance: When only some concrete objects need to share state

I have a series of classes that represent widgets in a layout system. The base class for all of these concrete widget types is Widget. If I have a Button and a Text Box, these both derive from Widget. ...
0
votes
0answers
88 views

Separate server for Flask-SocketIO chat functionality?

I currently have a Flask application which acts as the backend for my website. I intend to add live private chat functionality to my website using Flask-SocketIO. I was wondering, is it better to ...
-1
votes
1answer
94 views

Downcastings refactored using generics

I am willing to refactor some code that acts like a controller class executing work embedded in other classes. On one side it looks good as the controller is generic and what changes has been well ...
1
vote
2answers
54 views

Thin Controller: Make a Controller Service wrap other Services?

Say you have a HomepageController that' suppose to show all the blogs, users, gallery, and some members-only info (for logged-in users) Normally, it looks like this: <?php class ...
2
votes
1answer
32 views

Restrict domain model if service not being used

Logically how can I prevent a client from making changes to a domain model entity if a service is not used? For example: Let's say I have an Account class that contains Transactions to compute a ...
-4
votes
1answer
79 views

Why does this Android app validate email field on every character change and not just when the Save button is pressed?

There's this sample repository, which showcases different Android testing practices. One of the apps is android-testing/unit/BasicSample, which is very simple and, among other things, checks the email ...
1
vote
1answer
50 views

Adding Security Layer for multiple services

My web application at the moment accepts REST requests and handled via some controllers, which calls corresponding services to perform the logic. Now I want to add in some security logic before ...
2
votes
1answer
78 views

What are the points of apps like Sketch and Photosbhop when it comes to Web Development?

This may be an obvious question but I really don't understand this so if someone can help me that'd be great. Basically, I am in the middle of developing an e-commerce app for my database management ...
2
votes
0answers
74 views

Designing classes with information hiding [closed]

John Ousterhout (the inventor of Tcl/Tk among other things) has this interesting list of software design advice, from which I'll quote the first one: Design classes around information, not ...
-3
votes
2answers
104 views

Develop desktop apps with communication between

My boss asked me to develop for him a price quotes desktop software (he doesn't want a website), he wants to give the price list and the users of this software would write the prices according to the ...
1
vote
0answers
36 views

Single users database for many apps

I'm designing a database that holds the information for users of three diferentes apps that share the access to the data trough an API. For every user i'm storing credentials, profile and roles. What ...
0
votes
5answers
223 views

Is using overly specific names for variable/class/component names a good or bad practice?

Let assume that we have a system in which the users can chat with each other and we are working on the backend. We can name the service which fetches the chats in one of the following ways: ...
2
votes
1answer
191 views

How do I use polymorphism instead of instanceof?

I'm trying to make an abstract board game. In the game, a player can choose to make multiple actions within one turn such as placing, moving, or rotating a piece. I'm not sure if whether or not my ...
3
votes
2answers
161 views

OpenGL and global state

It is generally understood in software engineering that global state is bad. However, OpenGL has been designed very much embracing the concept of global state. many of the things you modify will ...
1
vote
3answers
181 views

How can I represent something like “latest news” in REST api?

Can't figure out how. 1) Resource identification. How do I identify the resource? Something like this? /latest_news/<id> That doesn't seem right. 2) Now suppose you have a URL for the ...
-1
votes
1answer
168 views

Creating a CMD like program (Command Line Parser)

I am creating a CMD like program where the user manage his "drive" with commands. I would like to know if there is a way of doing this type of application in a easier/better way. Actually I'm doing ...