Questions tagged [separation-of-concerns]

Separation of concerns is a design principle.

Filter by
Sorted by
Tagged with
-3 votes
1 answer
80 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 ...
user avatar
  • 97
0 votes
1 answer
90 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 ...
user avatar
1 vote
2 answers
148 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 ...
user avatar
  • 111
0 votes
0 answers
32 views

Rule of thumb for responsibilities in Vue projects

I'm using Vue3 with the composition API and Pinia. I want to avoid tight coupling but sometimes I don't know the best place for the logic. To give you some examples, I'm choosing Minesweeper ( I hope ...
user avatar
2 votes
3 answers
348 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 ...
user avatar
2 votes
3 answers
116 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 ...
user avatar
0 votes
1 answer
147 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 ...
user avatar
1 vote
2 answers
173 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&...
user avatar
  • 121
2 votes
1 answer
113 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 ...
user avatar
  • 149
0 votes
2 answers
242 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 ...
user avatar
-1 votes
1 answer
170 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 ...
user avatar
  • 59
2 votes
2 answers
129 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 ...
user avatar
  • 59
1 vote
1 answer
247 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 ...
user avatar
0 votes
0 answers
40 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 ...
user avatar
1 vote
2 answers
124 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 ...
user avatar
0 votes
0 answers
201 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" ...
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 ...
user avatar
-2 votes
1 answer
127 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 ...
user avatar
2 votes
1 answer
84 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 ...
user avatar
-2 votes
3 answers
814 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 ...
user avatar
1 vote
1 answer
217 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; } ...
user avatar
1 vote
2 answers
2k 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 ...
user avatar
  • 604
9 votes
6 answers
858 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 ...
user avatar
  • 667
0 votes
3 answers
384 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 ...
user avatar
  • 241
3 votes
3 answers
199 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 ...
user avatar
  • 57
0 votes
1 answer
171 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 ...
user avatar
2 votes
2 answers
217 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; $...
user avatar
  • 8,031
0 votes
1 answer
1k 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....
user avatar
  • 222
0 votes
2 answers
243 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, ...
user avatar
2 votes
1 answer
113 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 ...
user avatar
  • 369
0 votes
1 answer
126 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 ...
user avatar
0 votes
1 answer
78 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), ...
user avatar
8 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" ...
user avatar
9 votes
6 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, ...
user avatar
  • 8,031
-1 votes
2 answers
153 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, ...
user avatar
  • 445
5 votes
4 answers
6k 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, ...
user avatar
1 vote
1 answer
63 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 --&...
user avatar
  • 203
0 votes
1 answer
51 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. ...
user avatar
  • 111
0 votes
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 ...
user avatar
1 vote
1 answer
983 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 ...
user avatar
  • 492
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, ...
user avatar
5 votes
2 answers
13k 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 ...
user avatar
  • 109
0 votes
1 answer
179 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 ...
user avatar
  • 111
-1 votes
2 answers
158 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 ...
user avatar
  • 1,549
0 votes
2 answers
285 views

Is there a problem when data and logic are not separated?

You can do a lot with Excel. Even without Visual Basic Script. But the data and the logic is in one file, whereas normal programming languages usually have another file (or a database) for the data. ...
user avatar
3 votes
2 answers
3k views

Are service objects necessary in OOP?

I have been using AngularJs since a long time. Me and my team makes heavy use of services for retrieving the remote resources like Users which intern uses $http service so, basically, for each entity, ...
user avatar
  • 2,106
1 vote
1 answer
3k views

Separate presentation layer from data entities

I am building a software where UI, Business Layer and Data Access Layer are tightly coupled in a single tier. I want to decouple layers, because a change in the database can cause the change in my ...
user avatar
  • 113
1 vote
0 answers
99 views

What is the scope of business logic which should be placed in a stateless session bean?

I'm struggling to wrap my head around sizing business logic placed in stateless session beans. It is important that I have little experience in this topic. In the case I have now, there is a JEE ...
user avatar
2 votes
1 answer
463 views

Where is the best place to convert json to objects?

I have a Data Access Layer that uses a json API. If the structure of the program looks like: Controller | Data Access Layer Is it best to convert the response strings into objects in ...
user avatar
  • 55
13 votes
8 answers
7k views

Is it possible to keep logging code completely outside the business logic?

With the help of AOP, I can remove the logging code from my business logic. But I think it can only be used to log simple things (i.e. logging method entry/exit and parameter values). However, what ...
user avatar
  • 241