Questions tagged [separation-of-concerns]

Separation of concerns is a design principle.

Filter by
Sorted by
Tagged with
1 vote
4 answers
363 views

Is there any intent behind SRP other than SoC

Edit based on responses so far I am starting with an edit so as to save future contributors from going down the same path others have. I am only interested in contributions that stick to the exact ...
Ash's user avatar
  • 219
0 votes
1 answer
135 views

How to deal with overlapping domains?

I'm a Java developer and I'm try to separate my code to packages (modules, services, whatever the chosen unit of functionality is). Let's say I'm creating a system that tracks employees and the ...
Michal Krasny's user avatar
0 votes
2 answers
82 views

Where to specify UI views in a hierarchy of model objects?

In a Flutter app I'm developing, I have a class hierarchy of model objects of a certain base class. To take a typical example, the abstract base class could be Vehicle. Then I have a (pretty much) ...
Anakhand's user avatar
  • 177
1 vote
4 answers
787 views

Why are async/await allowed inside the domain model of DDD?

I am trying to challenge my understanding of DDD by pushing it to the extreme. My question is not about a specific practical use case. Rather my question is an abstract one related to DDD in general. ...
geeko's user avatar
  • 236
0 votes
2 answers
553 views

How to separate UI and business logic when they are intertwined by design

I am refactoring a legacy codebase of an Angular SPA. The central entity of the app is the chat room, and there is a plethora of ways on how to enter a chat from different views all across the app. ...
user2195738's user avatar
2 votes
2 answers
189 views

To maintain SOLID, should data preparation, conversion, and pre-computation for purposes of saving an object, be separate from data persistence layer?

I am facing a common situation where I am saving some values into database from a business object. I am using a relational database and usually I only need to save a few items that are part of the ...
Dennis's user avatar
  • 8,157
2 votes
3 answers
239 views

how to leverage overloading while keeping business logic out of models

I am running into a conflict between two best practice principles- overloading should be used instead of long chained if/else statements models should not contain business logic I am working on a ...
dbrewster's user avatar
  • 139
-3 votes
1 answer
117 views

Using two different languages where one would suffice for the task (microservices)

I previously asked this on StackOverflow, but doesn't fit there and I was suggested to move it here. I was thinking about using two seperate backend languages for seperating concerns in a project of ...
HackXIt's user avatar
  • 97
0 votes
1 answer
255 views

Blazor Application separation of concerns

I am building a cross-platform application and have planned to use Blazor. I have made similar applications in the past but using ASP.Net Core for the back-end and Angular for the front-end. I always ...
J.Paravicini's user avatar
1 vote
2 answers
2k views

Making data available for multiple microservices

We have a design challenge here for a project we are working on and I wonder if folks from the community can provide some guidance: Our product is built in a microservices structure. So we have ...
Luis Novo's user avatar
  • 111
2 votes
3 answers
626 views

How do you achieve encapsulation while "separating view and business logic"?

I've been trying to get a better understanding of OOP (I'm not the biggest fan of it, but I still want to understand it). One of the core principles of OOP is encapsulation - you're supposed to ...
Scotty Jamison's user avatar
2 votes
3 answers
123 views

Should a process be responsible for scheduling itself?

I need to create a very small service which will programmatically make a database insertion once a day. As our stack primarily uses Node.js, we’re going to write a JS script responsible just for ...
user3781737's user avatar
0 votes
1 answer
221 views

Designing functions with separation of concern in mind

Is there a name related to the pattern shown in the code that follows? Or is there writing/thinking on the [design of] code shown that suggests it is an anti-pattern? In general, I'm curious if this ...
tarstevs's user avatar
1 vote
2 answers
235 views

Is it a good/bad practice to create overlapping types?

Here's a simple example: an API returns a list of possible options with the following structure: { "familystatus": [ { "Id": 1, "Name": "single&...
noamyg's user avatar
  • 121
2 votes
1 answer
292 views

Separation of concerns

I'm approaching the DDD way and I was posing myself some questions. Assume that I'm writing an application that lets you define a nutritional week, where you can Define a nutritional week as a ...
Green's user avatar
  • 149
0 votes
2 answers
721 views

Architecting project into multiple source control repositories

I'm doing some work with my team to refactor/rearchitect some parts of our existing codebase which consists of two separate Django apps hosted in one common project repository. We're starting work on ...
Nick Gotch's user avatar
-1 votes
1 answer
209 views

New frontend for legacy code

How would you engineer this: You have a legacy application that is a big ball of mud and a monolith. This application is "impossible" to change to look good on mobile devices. The management ...
emajl's user avatar
  • 59
2 votes
2 answers
137 views

Use old legacy application code from new application

If you have a big legacy application (big ball of mud), lets call it MudApp. If you then create a new application to make us of new technology and to make a new good looking frontend because that was ...
emajl's user avatar
  • 59
1 vote
1 answer
487 views

In which layer should I load views on a Clean(ish) architecture?

I am trying to organize my architecture following the clean architecture while using some common practices/frameworks. I'm writing in PHP, but have no problem with other languages. The flow of my app ...
Erick de Azevedo Lima's user avatar
0 votes
0 answers
42 views

Using a bulletin board to support Separation Of Concerns

Context: I'm working on an embedded system with many small functional modules. The business logic within each module is made as simple as possible, but those modules generally need to gather bits of ...
fearless_fool's user avatar
1 vote
2 answers
150 views

How does one choose where to place logic which converts data between two formats/representations?

Suppose I have two "modules", A, and B (I'm choosing not to use classes, because you generally can't create an instance of a module, which makes this question simpler). These modules contain ...
taylorthurlow's user avatar
0 votes
0 answers
431 views

What's a valid use case of JPA annotation @Transient?

I'm new to JPA and Hibernate. I just saw an annotation called @Transient, which can mark a field to be non-persistent in the database. However, for the sake of "separation of concerns" ...
johnlinp's user avatar
  • 121
0 votes
0 answers
41 views

Use debug-functionality without breaking architecture

note: This is of couse about software-architecture/design-principles, but as no architecture is completely detached from its language, please note that the language i am using is C++. I am using an ...
LeonTheProfessional's user avatar
-2 votes
1 answer
207 views

Understanding Headless CMS architecture from an engineering (rather than a user) perspective

TLDR: In a Headless CMS (or a Decoupled CMS), the content retrieved by the front-end needs to be identifiable (somehow). This is where I'm stuck. I can describe my guesses of how platform-agnostic ...
Rounin's user avatar
  • 275
2 votes
1 answer
115 views

Separating Plotting and Computation Logic in Scientific Computing MVC App

I’m developing a Matlab GUI for a scientific computing application and need to plot fairly heavy intermediate results. Currently, the computation is represented as a function. The GUI accepts user ...
Dragonsheep's user avatar
-2 votes
3 answers
2k views

Best Practices for Managing SQL Code

I have a issue that keeps coming up as a developer using any .NET (C# mostly) and SQL. I personally feel it is bad practice to build SQL statements in code. There are too many case scenarios that may ...
CaveTroll's user avatar
1 vote
1 answer
336 views

Include Get Password function in User Domain without violating separation of concerns

Problem: I am using a Domain Driven Design architecture and I have a domain model called User as follows: public class User{ public User(string username){ this.Username = username; } ...
Ricardo Duran's user avatar
1 vote
2 answers
3k views

How to Validate a Child Object Based on Parent Object's Data

Taking into consideration that I'm making an attempt at Domain-Driven Design and overall good separation of concerns when it comes to business logic, data access logic, etc... Question: How do you ...
HardCode's user avatar
  • 614
10 votes
6 answers
1k views

Does bootstrap break separation of concerns and defeat the purpose of CSS?

Although I have seen a few Bootstrap sites, I have only just started to look into it seriously and I was quite shocked by what I saw in the HTML - loads of nested divs with multiple classes attached ...
Andy's user avatar
  • 687
0 votes
3 answers
475 views

Do higher order functions violate the separation of data and code principle?

I am asking here something that is really haunting for years (for real !). I guess in a "perfect world", we would have programs made of data models and functions, and those functions manipulate data ...
ibi0tux's user avatar
  • 241
3 votes
3 answers
240 views

Is this a good method of separation?

I am creating a web application that is tiered in the following way: Controller > Service > Repository I have a ProductsController which has the following action: [ValidateModel] [HttpPost] public ...
KTOV's user avatar
  • 57
0 votes
1 answer
172 views

Seperation of concerns: Submitting a form to create an email, store it and send it

Context I have a workflow that has an email form. The requirements are the following: A user completes the form that contains email fields and submits it. If everything goes well then an email model ...
Andreas Andreou's user avatar
2 votes
2 answers
220 views

What is wrong with writing web applications in a way that merges repository layer with view and with controller in the same file?

is there anything wrong with writing code in a way that merges view, repository, controller in the same file? i.e. global $db; // or $db = DBSingleton::get_db_instance(); // or global $container; $...
Dennis's user avatar
  • 8,157
0 votes
1 answer
2k views

Simplest Architecture to separate UI and business logic on Windows

I guess the goal of separating UI and business logic goes way back. I found a Martin Fowler article, from nearly 20 years ago, which is pretty clear about the benefits of the separation: https://www....
whytheq's user avatar
  • 222
1 vote
2 answers
307 views

Reuse domain entity logic

Usually the domain logic should be contained in the domain entity, rather than being put in specialised external classes called from the entity. This is good to prevent that somebody comes later, ...
Kamafeather's user avatar
2 votes
1 answer
118 views

Put functionality in same executable with command-line flag, or put it in a separate executable?

Background: I am working on a service where the domain logic exists as a library, and then the actual executable is built on a web framework as a wrapper around the domain logic library. There is no ...
kqr's user avatar
  • 369
0 votes
1 answer
134 views

Separation of concerns SOAP Services

I'm having a discussion in my company on how to structure a student enrollment application we are doing. We have an SOAP-Service for sending Emails. This Service is in charge of sending, and logging ...
CodeHacker's user avatar
0 votes
1 answer
100 views

Separation of Logic and UI - Does the orchestration belong in the model?

I wrote an app with the MVP Passive View pattern. My solution has four different projects. A MyApp.Core containing all kind of business logic, a MyApp.Forms containing stuff related to WinForms (UI), ...
selmaohneh's user avatar
10 votes
7 answers
3k views

Separation of concerns: When is it "too much" separation?

I really love clean code and I always want to code my code in the best possible way. But there was always one thing, I didn't really understand: When is it too much of "separation of concerns" ...
TheOnionMaster's user avatar
10 votes
7 answers
3k 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, ...
Dennis's user avatar
  • 8,157
-1 votes
2 answers
158 views

How to choose the most suitable solution for a problem given some choices?

To ilustrate my main concern let's start by considering a "trivial" typical problem, data filtering & parsing coming from a process and dumping the information onto something {gui console, file, ...
BPL's user avatar
  • 455
5 votes
4 answers
7k views

Separation of application logic and domain logic in Clean Architecture

I'm struggling with the separation of logic between entities and interactors or Use Cases. If I design the entities with DDD principles, each entity would have methods corresponding to use cases, ...
FedericoG's user avatar
1 vote
1 answer
65 views

Rx stream resulting in lots of one-off objects

My domain space is Java + RxJava but I think this applies to any reactive framework I have a stack that looks like the diagram below. Just for examples sake I'm describing a login flow but any UI --&...
tir38's user avatar
  • 203
0 votes
1 answer
54 views

Separation of concern. Accessor methods and data sanitisation.

I have a great deal of 'dirty' data pulled from an API request. Before database insertion, I clean out a lot of line feeds and regex out values such as height and width from item descriptions. ...
pcgben's user avatar
  • 111
1 vote
4 answers
1k views

Avoid type checking but preserve separation of concerns

I'm working on an MVVM project and trying to preserve separation of concerns. Our current architecture has an entity framework model and MVVM light view and viewmodel projects. I'm working ViewModel ...
Felix Castor's user avatar
1 vote
1 answer
1k views

Making UnitOfWork testable

I'm in the process of refactoring legacy code. Unfortunately it is a WebForms application with very tight coupling and smelly code. Currently access to database is inside models which looks something ...
FCin's user avatar
  • 522
5 votes
3 answers
1k views

Separation of concerns for a "Manager" class

I have a Class that "controls" the current application state, ApplicationStateManager. I have an Enum that lists the possible states for the application enum ApplicationState { Idle, ...
Joao Vitor's user avatar
5 votes
2 answers
14k views

How to separate the ViewModel from the Model, yet associate them with each other based on the Model?

In a wpf application, a Model object is created either from scratch or deserialized from some .xml file. To create a connection to the ViewModel, the following method (on the Model!) is used by the ...
surface's user avatar
  • 109
0 votes
1 answer
188 views

BLL Layer with physical file path

So I am working on an existing website project that has a BLL layer with some functions that use physical file paths. But now I am creating a console app that will be setup as a windows scheduled ...
SharpCode's user avatar
  • 111
-1 votes
2 answers
162 views

How to Avoid Missed Behaviors when Separating Code from Data

I've come across something that I find decently frustrating while adding new functionality to our large existing code base. Preface We have a variety of classes (ItemA, ItemB, ItemC...) that ...
plast1k's user avatar
  • 1,559