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.

1
vote
1answer
98 views

UI in code behind vs UI in specific view language/markup

I have heard some developers say they prefer to build their UIs in code behind... I am of the opinion that this leads them to write really bad code... Super large functions, spaghetti code, and mixed ...
5
votes
1answer
331 views

Is there a thing as “too many threads”

I wasn't sure if here or SO was the right place to ask this, but here goes anyway. So I want to improve a system that is currently running. It has services and many stand alone apps, but none of ...
0
votes
6answers
216 views

How to restrict method's parameter to the class, where the method is overridden

I have quite simple class hierarchy: public class Base { //... public virtual void AssignFrom(Base baseObj) { //DoSomeStuff } } public class DerivedA : Base { //... ...
0
votes
0answers
50 views

Pulling analytics metrics from java application without code modifications

We use spring 4.3 and spring boot version 1.5 in our java based web application. For (product) analytics purposes we want to read the metadata of our product which is persisted in an RDBMS store (...
0
votes
1answer
121 views

Is the usage of flip function a smell for bad design?

Everything is in the title, is the usage of flip function a smell for bad design ? I'm coming from a JavaScript universe and used to work with lodash/fp or ramda. Recently, I've written some stuff ...
1
vote
1answer
135 views

How to handle a large amount of very specific use cases

So I'm writing a program that runs quite a few different tests. Which tests are ran varies based on which UI elements are selected by the user. For example, on one form I have 7 radio buttons and 6 ...
-1
votes
1answer
47 views

Best OOP practices for object accessing “aggregate object” members?

Is there a best practice for something like this? (Example in C++) class A { public: int usefulParameter; std::vector<B*> bContainer; }; class B { public: void ...
0
votes
0answers
46 views

Provide extension points to library

I have a library that provide some common logic for reading settings from multiple sources. the library uses a chain of responsibility to populate instances of objects that will contains the settings ...
0
votes
1answer
138 views

Properly named factory method vs chain of rules

I have a requirement to have a component that will check input against some rules in a strict order. The order of the rules is defined by the business. To keep example code simple, I'll try to define ...
13
votes
5answers
541 views

Is it possible to apply DRY without increasing coupling?

Assume we have a software module A that implements a function F. Another module B implements the same function as F'. There are a number of ways to get rid of the duplicate code: Let A use F' from B....
1
vote
1answer
64 views

Cleanly testing multiple Preconditions before throwing an IllegalArgumentException so that all failures are represented

Motivation; I want to report on all the possible problems at once instead of having to peel the onion of every possible problem over and over. It also makes testing much easier because I can ...
1
vote
1answer
83 views

Improving my inelegant Haskell deduplication function

I'm working on learning Haskell, and one of the simple exercises I put myself through to this end is writing a function that deduplicates a list, removing all of the duplicate elements of a list such ...
3
votes
1answer
66 views

Where should I specify validation messages?

I'm creating a Functional Specification Document (FSD) for a project. I'm pretty confused as to where I should specify error messages? Do they belong in the FSD, or are they part of the Technical ...
1
vote
1answer
114 views

Where to convert int to enum in a 3-tier architecture?

I have a situation where a DB field is storing an enumeration value whose underlying type is int, so I'm getting back values like 0, 1, and 2, which should represent MyEnum.Foo, MyEnum.Bar, and MyEnum....
1
vote
0answers
59 views

Polling Postgres DB architecture

We are using Spring Integration DB polling which polls a table every second and executes some logic based on result. My questions are: What are some good practices we can implement to account for DB ...
1
vote
0answers
66 views

How to design the Unity Container?

I have three projects: WebAPI, Services and Repository. WebAPI has a reference to Services and Services has reference to Repository. Now I need to add a Unity Container for Services and ...
0
votes
1answer
38 views

What are good strategies to use for learning the workings of larger systems? [duplicate]

For obvious reasons (be a better developer) I desire to gain a deeper understanding of not just my code, but the systems / frameworks / libraries that I work with. As a senior-ish dev* I feel I should ...
0
votes
1answer
56 views

Web designer equivalent in Android and iOS worlds?

When web came, for years designers would create stunning designs in Photoshop, and developers would try to translate those designs to HTML/CSS/JS. This had many problems with itself. Lack of ...
2
votes
5answers
237 views

How to pass command line parameters to various parts of program

Consider a large program with many different parts that have a single command line interface, as is the case with most applications. How best do I handle passing various command line parameters, that ...
-3
votes
2answers
210 views

What do I need to do before starting a project? [closed]

This is quite a silly question, but I really don't know what to do before starting a project. Take this project for example: https://github.com/kutlugsahin/smooth-dnd/ This project to me is quite ...
0
votes
1answer
47 views

How should “preparation” and “usage” of the same data be separated in a DDD application, if at all?

In most domains, there is an app that "prepares" data, and another app that "serves" the prepared data. The data, however, is from the same Core Domain, which causes some confusion in modeling. Some ...
1
vote
1answer
97 views

Should you allow user to override normal behavior

This is more of a subjective question and i don't expect a perfect anwser. I have different behavior/rules in my system. for example : I have a behavior in my system that allows users to register to ...
1
vote
0answers
26 views

Applying an overloaded/templated function depending on the type of a QVariant

I'm trying to take a QVariant (in this case from a QProperty generated on a class) and based on the type, return a QWidget that allows for it to be edited appropriately. a signature for the ...
0
votes
0answers
69 views

Handling Failed DB Insert

I have a application that constantly checks for messages inside the Rabbit MQ. When a message is received, I will parse that message and insert it in the DB. I am wondering. What if it fails? What ...
0
votes
1answer
116 views

Variable vs value in a user interface label as a method parameter

Imagine I have updated a user interface label with a value. Since this is a label, end user cannot update the value directly and can only be changed through code. Lets say the value is X. X could be ...
2
votes
0answers
61 views

Memento and releasing resources

Let's suppose we have a class whose state has to be saved and later restored, and we resorted to the Memento pattern for that. What if the state includes resources that have to be explicitly ...
65
votes
7answers
15k views

If functions have to do null checks before doing the intended behaviour is this bad design?

So I don't know if this is good or bad code design so I thought I better ask. I frequently create methods that do data processing involving classes and I often do a lot of checks in the methods to ...
2
votes
2answers
497 views

Technical documentation vs Software design documentation

I am trying to start a documentation about a class library that is already finished/developed. The purpose of the documentation is to be used by other developers in order to understand what kind of ...
1
vote
1answer
69 views

Design: HTTP and Websockets working together

I'm at a bit of crossroads here and I wanted to ask the opinion of the community. I am creating a chat application for our company. Now, like every chat application out there, the messages are saved ...
-3
votes
1answer
51 views

How to make a configurable design in restaurant delivery problem? [closed]

The problem is like there are few restaurants and few delivery guys available. Each restaurant has a meal order and the delivery guys are to be assigned to the restaurant. Now there may be many ...
2
votes
0answers
49 views

Designing a test system on server/message level for large legacy application

I am working on introducing tests to an old system. Because of the amound of technical debt, we have landed on component/interface testing. The system is a servies of servers which sends messages in ...
0
votes
2answers
214 views

Code Coverage and Defensive Programming (in private functions)

Assuming you want to build automated tests for the following (very simple, if odd) class. // Calculates the distance between neighboring values in a vector // and provides functions to return the ...
2
votes
1answer
144 views

Is it a good idea to release an application with custom performance counters?

I have been reading on C# Performance Counters and I was wondering if I should be keeping them in my release build? I have never encountered an application that has it's own custom performance ...
30
votes
9answers
5k views

Designing a Class to take whole classes as parameters rather than individual properties

Let's say, for example, you have an application with a widely shared class called User. This class exposes all information about the user, their Id, name, levels of access to each module, timezone etc....
2
votes
1answer
119 views

How can i design this?

Say I have different types of operations which i need to perform. I have an abstract class 'BaseOperation' which has all the information common to all operations. Now i need to categorize these ...
1
vote
5answers
541 views

Designing a card game

I want to expand my personal projects portfolio, so I decided to make a card game. To be more precise, it's called Macau. I've read this answer on StackOverflow and tried to follow the steps from the ...
0
votes
0answers
17 views

API design for mobile mapping application

I am working on a mobile application that displays a map with various markers, these markers come from a multitude of third-party APIs. The concept I had in mind was to develop a web app hosted on ...
2
votes
2answers
153 views

Input based data fetch optimization

Is there a cleaner/ better readable way to maintain and iterate many-many mapping rather than multiple if conditions ? (One way would be to store the mapping of ReportType -> DataSet Req. in the ...
1
vote
4answers
909 views

What is the proper place for complex business logic

I have an object that describes a two-dimensional Graph: class Graph { var points; // Array of points } Now I need to find some complex patterns in this graph, like (but more complex): Find two ...
2
votes
2answers
91 views

Communicating the intended operation of API business logic to both developers and business people

Currently, I'm designing the intended operation of a (RESTful) API which a team of developers will eventually build. I'm not concerned with implementation details, as long as inputs are correctly ...
1
vote
2answers
83 views

Designing a graph-like drawing application

I am dealing with a drawing app that allow the user to draw a set of Components (which are like the graph vertices) and they can be wired (like the graph edges) on each other to simulate how their ...
0
votes
2answers
139 views

am i asking for trouble? DB & dealing with variable item records

I feel this is so basic, but it just seems too easy and obvious and why didn't someone suggest this 10 years ago. And I know there a lot of much brighter people than me in the software dev business......
1
vote
2answers
73 views

Real Work in Constructor vs Factory Method [duplicate]

So been doing a lot of reading/research into clean code/design, OOAD, refactoring, TDD, etc. Just trying to improve my designs to be easier to extend and maintain. One thing that is come up quite ...
-1
votes
1answer
24 views

How to implement linkedin authentication/data sharing with multi party?

Hi I am working on application 2. My application interacts with application 1 and 3. Clients of application 1 need to be to share their linkedin profile information with application 3. I have ...
-2
votes
1answer
122 views

Avoiding multiple calls to SQL and persist data

I often received messages objects and for each of them I need to query the database in order to achieve some additional information from one database table. Since we are performing many requests to ...
0
votes
0answers
20 views

Web application with plugins: how to transfer orders between plugins

This question is about the application's architecture and is thus language independent. Should it matter: I'm using python 3.6 and http.server. Context and architecture I'm writing a software that ...
2
votes
1answer
192 views

Is my three layer architecture well implemented?

I'm working with visual studio. The solution contains the 4 following projetcs : DAL Works with Entity framework + Repository pattern. It contains the DB classes + Repositorys. BLL It contains ...
2
votes
2answers
72 views

Is ER model used in database design and software design the same thing?

ER model appears in both database design and software design. I was wondering if ER models in both designs are the same concept? If not, what are their differences? Thanks.
0
votes
0answers
77 views

Game Model Architecture?

Just for background, this is a project using Swift and GameplayKit. I've dealt with MVC and simple design patterns and architecture. Shout out to this thread(What architecture should I use for my game ...
1
vote
1answer
63 views

How to design service layer when working with model objects and relationships

I have a simple relationship where top-level items (Recipe) have a one-to-many relationship to children (Ingredient) and each item has a unique identifier (ID). For simple CRUD operations the flow is:...