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.

0
votes
1answer
41 views

Design scalable solution with queue

Assuming the following scenario: A web application that receives inputs from the user and process the inputs through an algorithm which takes between 5 to 25 minutes (depending on the inputs) and ...
1
vote
3answers
92 views

Usage of both is-a and has-a relationship?

So if I have a class called Object, a class, bench, that derives from Object, and finally a class called Park that derives from Object that has-a bench - is this bad "practice", to have two objects ...
0
votes
0answers
60 views

What's the benefit of separating specialised data from behaviour in an algorithm?

Functional programming strongly suggests to separate data from behaviours (functions). However, I can't see the benefit of this for an algorithm's implementation intrinsically tied with particular ...
0
votes
3answers
125 views

Calculating the total price of items in a shopping cart

I am making a shopping cart. A shopping cart will have a total amount of money you've got to pay for the products you've selected. I'd like to approach the problem using both OOP (encapsulating it) ...
0
votes
0answers
46 views

Challenges in Consuming Slow API's

We need to integrate a chatting software in our web application (and mobile app). The chat software could be accessed by our users from outside of our application too. The integration goal is to let ...
7
votes
5answers
294 views

Information Hiding v.s. Static Type Safety

I'm working on a project with others and we have a discussion about information hiding and static type safety. Our scenario is described below. Language: C++11 Scenario: We want to create a tree-...
0
votes
1answer
62 views

Design a 1D parking lot that could park a two wheeler (1 slot), a car (2 slots) or a bus (4 slots)

This question is an extension to this question. I am also brainstorming on this problem statement wherein a 1-dimensional parking lot having N slots will be having varying size parkings to do. A two-...
1
vote
0answers
21 views

User level customised activity feed design

I am working creating api for activity feed of user. Feed contains different type of entities. Before that let me give you bit overview about the app. Its a video app where Users can ask questions ...
0
votes
0answers
36 views

Should a new access control mechanism use a precedence-based or an order-based permission system?

Let's say I have users, groups (or "roles") and resources, and I want to manage various permissions on those resources. As far as I can see, there are two main "philosophies" when it comes to ...
0
votes
0answers
23 views

Aggregate inheritance in DDD [duplicate]

So one thing you do not hear much about is inheritance with DDD. Currently I have an Account aggregate that handles details regarding a financial account and its subaccounts. Then a Transaction ...
0
votes
1answer
28 views

Watchlist polling API NoSql vs Sql Frequent Updates

I am making a watchlist type application that will get all items being watched and then poll an api every ten minutes or so to check on its status. I am trying to design the database portion of this ...
1
vote
1answer
48 views

Build an object from two data sources - Which design pattern would be suitable?

Problem statement - I have to construct an invoice (having line-items, legal details, payment details etc) using booking and payment information of a hotel booking. There are two sources for these two ...
0
votes
2answers
59 views

How to allow arbitrary database connections based on users selections?

I'm writing an application which would allow users to access the databases over the network. Currently the user enters database details in a form which are later used to establish a JDBC connection. ...
1
vote
1answer
79 views

How to set nullable/optional property of database object to NULL in backend?

We are building API which mainly passes database objects back and forth between user and database, so the main flow of information is quite basic: Table (view) <-- ORM --> C#/Java/etc. Objects &...
0
votes
1answer
86 views

Can I use the memento pattern with multiple relationships and persistence?

I need to implement a rollback system and the memento pattern gets mentioned regularly as a solution to this requirement, but in all cases a single object is used and it works in memory, persistence ...
0
votes
1answer
148 views

Is there a design for C# that removes the need for dynamic?

I have a web service that implements Repository Pattern and I was wondering if there is a design in C# that can remove the need for 'dynamic' when injecting it in my method. public interface ...
0
votes
1answer
46 views

Calculating time an object stays in a state

I use Python sqlalchemy to store my model in a MySql database. One of my objects has a 'state' field (for simplicity let's assume there are two states: AVAILABLE and UNAVAILABLE). There are ...
2
votes
1answer
55 views

What to choose, ioctl-like interface or a set of distinct methods?

I am implementing a messaging protocol between nodes on a network and i am wondering how to expose the messaging system interface to the programmers. The messaging protocol supports a set of commands ...
0
votes
1answer
44 views

Domain events or services to achieve domain model consistency?

Recently began implementing domain events in my domain layer which really allows me to decouple the application from the domain. Eventually, I would like to get a full-scale CQRS w/Event Sourcing ...
0
votes
2answers
73 views

In which layer should a microservice should send a message to another microservice

In our monolith application, the piece of code that used to handle sending SMSes and emails was written in our business layer. Now the responsibility of sending emails and SMSes is handled by a ...
0
votes
1answer
47 views

Fastest way to return a list of records depending on many many-to-many relationships

I'm developing an API in Rails and the following requirement is established (it's really more complicated, but I want put a simple example): There are users and messages. users have a gender (...
0
votes
0answers
32 views

Where to put business calculation logic in CQRS read/write models?

I have a personal finance 3-layer application setup as: UI, BLL, and DAL. My domain looks like: // Write Model public class Account { public Account(AccountId id) { _id = id; } ...
1
vote
1answer
37 views

Repository pattern, call another API that updates a SOR's from service or repository class?

We are working on API's that call other API's that will inevitably retrieves/update a system of record like an SQL, MySQL or other database. Sometimes we'll have 3/4 layers of API's before the SOR is ...
0
votes
0answers
60 views

Advice wanted on exceptions handling. Annotated, Pojo or Hierarchy

While building some recommendations I wonder what is the favorite way to handle exceptions. The finality is to return a meaningful message to the user (being human or machine). I see 3 different ...
1
vote
2answers
161 views

Best practice on how can I change the structure of a live database without losing data inside

Suppose I have a live website running on a live database and I have a dev website that is a duplicate of the live website. The live database is where customer transactions are stored. Suppose I do ...
1
vote
4answers
112 views

High class cohesion violates ubiquitous domain language

Originally posted at CodeReview, but it was brought up that this would be better posted here. The other question has been deleted. Creating some personal finance software, but running into an ...
2
votes
1answer
80 views

How to white label my website in php

I have a website that follows the following structure: www.example.com/city1 www.example.com/city2 ... Programmatically we change the logo which is hard-coded in a specific config file for city 1, ...
0
votes
2answers
73 views

Appropriate design for restoration of previous states

This is a very common feature in software, and I am sure there is a whole deal written about it, but I really don't know what the technical term is, so here I am: I am talking about giving your ...
0
votes
1answer
62 views

Passing messages through a chain of containers in python

When I write python code for simulations, I often end up with the following situation: I have a class describing the general environment which contains a list of instances of a class that describes ...
2
votes
0answers
99 views

Is this an example of cyclic dependency?

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview. I have wrote my ...
2
votes
2answers
73 views

Separate variable value from error code using struct

Let's say I have a function that calculates a sensor output, all values are >=0, but also I have to detect some error situations like "NO_POWER" which I encoded with value "-65500". On my application ...
-2
votes
2answers
82 views

Same interface in constructor class but reference to concrete class

during my work my collegue push one class that have an costructor with two parameter of the same interface but he has used the reference to the concrete class. I wanted a comment on this scenario ...
0
votes
0answers
38 views

Start a timer based on a different event firing

So I have a design issue I cannot seem to figure out how to do, my situation is as follows: I have multiple array of timers, one of which should be reset when the corresponding key, and then a ...
-2
votes
1answer
74 views

what is the real use of JS/Jquery in Asp.NET MVC application?

I am planning to design a new web application using ASP.NET MVC 5. I used to write a lot of JS/Jquery code on UI when I was a beginner with Web forms applications. After reading/learning a lot of ...
2
votes
1answer
73 views

What's the best way to design batch job type processing

I'm working on a portion of an ERP system where I need to process data in a way that's similar to a series of batch jobs, and I'm struggling with deciding the best program architecture to use. I'm ...
-4
votes
0answers
53 views

How to design an Android app?

GOAL: I've started to write my first Android app and I made a lot of mistake, for example: putting every method and variable inside the main activity; not using single responsibility principle; ...
0
votes
0answers
36 views

How to design my site solution correctly

I have a website that consists of users (more about the types below) and vacancies. Users can subscribe to vacancies and contact other certain types of users. While organizations and governments can ...
1
vote
0answers
66 views

Hierarchy of models while designing a client for a RESTful service

I am trying to write a client for a restful service. I am confused in designing the models. Below are the details: I have a Model named UnicastMessageRequest, it's definition is like this: ...
9
votes
6answers
2k views

Did Dijkstra intend for code modularization, when he wrote about separation of concerns?

First, I read an excerpt Edsger W. Dijkstra's 1974 paper "On the role of scientific thought": Let me try to explain to you, what to my taste is characteristic for all intelligent thinking. It is, ...
-2
votes
1answer
69 views

How to start designing a complex information system?

Recently I've been assigned to a new project to start with designing and visualizing business processes. Unfortunately I just can't wrap my head around this one, I understand what the client wants but ...
2
votes
5answers
517 views

Is it better to write an efficient algorithm or code that is easier to understand?

So I was recently given a coding assignment from a large financial firm, and I thought of two ways to solve the problem. One of the ways involved 1 outer for loop and 1 inner for loop. In this case, ...
1
vote
3answers
227 views

Why using methods for database queries instead of raw queries?

What's the reason behind making methods for database queries instead of allowing raw queries? for example get(...)->where(...). Guess1_ We're repeating ourselves otherwise(DRY) ---> I don't think ...
0
votes
1answer
36 views

How would you design the abstraction/class(es)/component(s) of a third-party service/api used in your application?

Lets say you were designing a Twitter client for people with people could see tweets and post tweets? How would you design the twitter api abstraction? Many of the api wrappers I've seen feature an ...
0
votes
1answer
43 views

Data Integration Design Using Microsoft SSIS

I am working on a data integration project, where I need to extract data from oracle source and load it to XML file. The requirement is to get the list of customers and foreach customer create an xml ...
0
votes
1answer
84 views

how can a web server know all the tabs served by it (for the same session) in the same browser?

This is in the context of my bismon program (GPLv3+, on github, still unreleased, alpha-stage), which is mostly a single-page web application (with a garbage collected DSL in it) which uses the ...
1
vote
1answer
104 views

How should we approach layered-architectures that need large amounts of continuous, real-time, communication?

Background In much of the literature I've read online with respect to multi-layered architectures, many people describe how to create the simple application where: UI presents static model objects ...
0
votes
2answers
104 views

Design Pattern to extract arbitrary field from arbitrary file format

Lets say I have multiple file types: .json, .csv ... etc These file types come in different formats: Second json structure Extra column added to csv etc. I need to extract fields from these files;...
3
votes
1answer
100 views

Is good or bad practice to share reporting modules between systems/apps?

At my new work, a few people want to share modules between systems/apps, and I'm a bit skeptical about it. Context: we have a lot of little apps living in different servers, some of them are ...
0
votes
1answer
184 views

Hiding raw pointers from public API but need to pass them internally - design review

I am designing and prototyping an ncurses C++ wrapper. It's a hobby project, nothing too serious. I will omit include guards and stdlib includes etc. Consider the following files: application.hpp #...
2
votes
1answer
32 views

Server-client CLI messaging design

I'm prototyping some single machine, single user software with a client-server model; the first client for which will be a CLI, but I expect a (local) webapp/GUI to come later. For the CLI, I'd like ...