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 [separation-of-concerns]

Separation of concerns is a design principle.

1
vote
0answers
33 views

decouple business logic from supporting logic

To prevent business-logic functions from being bloated with supporting-logic* of shared concerns (e.g. authentication, authorization, logging, profiling, ingress rate-limiting) many backend frameworks ...
0
votes
0answers
52 views

Is There a Pure Pull Relational Reactive Programming Platform?

An aspect of evaluation scheduling appears in various disciplines under different names. If you are familiar with any of these pairs, focus on your experience with those pairs to understand the topic ...
2
votes
1answer
72 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 ...
-3
votes
0answers
26 views

Design Pattern for Material Feasibility Check service as described below

We have MaterialTemplate, Material as below MaterialTemplate{ MaterialType materialType, int length, int width, int complexity } Material{ MaterialType materialType, int ...
0
votes
1answer
40 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 ...
0
votes
1answer
31 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), ...
6
votes
6answers
541 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" ...
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, ...
-1
votes
2answers
86 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, ...
1
vote
4answers
525 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, ...
0
votes
0answers
946 views

Separation of authentication/authorization in microservice architecture

So I'm currently trying to design a microservice architecture for a side project. I chose the microservice architecture primarily because it's just my own side project, so I want to learn something ...
1
vote
1answer
37 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 --&...
0
votes
1answer
43 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. ...
0
votes
4answers
266 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 ...
1
vote
1answer
312 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 ...
5
votes
3answers
634 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, ...
2
votes
2answers
3k 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 ...
0
votes
1answer
95 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 ...
0
votes
2answers
139 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 ...
0
votes
2answers
184 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. ...
1
vote
2answers
696 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, ...
1
vote
1answer
1k 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 ...
0
votes
0answers
105 views

How can an API not conform to Client-Server REST constraint

I've been reading about REST, and I am struggling to understand why the Client-Server is included. To paraphrase, the client-server constraint requires a separation of concerns between the server and ...
1
vote
0answers
80 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 ...
1
vote
1answer
185 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 ...
7
votes
8answers
2k 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 ...
8
votes
2answers
387 views

How to cleanly separate different parts of a software application?

I am designing a new application that deals with a lot of business logic. To avoid the usual entanglement between different application layers that often sneaks into such systems over time, I want to ...
0
votes
1answer
42 views

Using business objects with composite ID from a different module

We have two modules: D and S. S has a Web Service interface, which is being used by D. S's responsibility is managing a domain of objects held in a folder-like structure. So, it contains a method ...
8
votes
1answer
1k views

Separate object used in business layer, data layer and presentation layer

I'm building an application that is responsible for reading data from files and displaying them in charts. The whole application is responsible for manipulating data from files, which means I have to ...
5
votes
3answers
86 views

Valid uses for DEFAULT clause in a table column definition, besides sequence nextvalue()

In a recent question, there's a debate whether or not an arbitrary default value in the definition of a column in a table is considered having business logic in the database. As we know, if an insert ...
3
votes
1answer
164 views

Should a State Machine or Processing Engine be abstracted away from the UI?

I'm working on a suite of micro-services, with a web-based GUI. We are using a 3rd party state machine via REST calls. Sometimes we get/set state from one of our micro-services, while other times we ...
2
votes
3answers
679 views

Should Data Access Layer mirror my Database Configuration?

I am trying to decide how (or whether) my Data Access Layer should deal with existing security and integrity protections on the database. The architect in me says that separation of concerns is a ...
3
votes
4answers
122 views

How to separate the logic of my application into a dependency when it is coupled to the structure of the data?

I am about to start prototyping a 'quiz'-like web application that tests test-scoring methodologies, and I have an interesting architectural question. Each quiz given to a user needs to use a set ...
0
votes
4answers
200 views

Should database tables be separated by concern?

My question is related to when should a database table be broken into multiple tables with relations? However, I have a clearer one-to-one relationship than in that question. If I was designing the ...
2
votes
5answers
470 views

Database transaction and separation of concerns

Apllication structure: Business layer public interface IOrderDataService { void Save(Order order); } public interface IOrderLineDataService { void Save(OrderLine orderLine); } public ...
1
vote
2answers
144 views

Separating save logic from WinForm to make it reusable

I have a Windows Form for creating configs. It has around 50 fields of data, which represent a group of entities, that I need to capture when the user presses the save button. Currently, on the press ...
1
vote
0answers
89 views

How to convince teammates to start separating database queries into one single layer

We are using ORM with bunch of database models and those ORM database queries (and models, of course) - are literally all over application from top to bottom. And when change in model structure ...
1
vote
1answer
223 views

Should composition happen no matter what?

I feel like I should be able to register all my components into the application composition root container no matter what the current state of the environment is, even in the case environment lacks ...
3
votes
2answers
139 views

Proper design for models

I have a class called ReplaceRule this is used by 2 classes DocumentRuleViewModel and SectionRuleViewModel as a List<ReplaceRule> in both Question 1: In my database implementation I have 2 ...
1
vote
3answers
144 views

SOLID principles and generating many objects from a file

The "D" in SOLID stands for dependency inversion. If I have for example, a Blacksmith class that depends on Hammer, I should create my Hammer externally and pass it to Blacksmith, rather than having ...
0
votes
1answer
80 views

Should models be returning data directly to the client, or to the controller instead?

Disclaimer: This is my first time: using node, creating a REST API, and trying out MVC server side. (so, just statistically speaking, I'm probably doing something wrong ¯\_(ツ)_/¯) I'm working on ...
3
votes
3answers
197 views

Why do we separate Data Retrieval from View?

I am seeking a good argument for: Why is it NOT a good idea to embed data retrieval code in my view? Example <tr> <td>Product</td> <td><select name="product"> ...
5
votes
1answer
268 views

Increase code duplication to simplify business rules in views

I am in the process of writing a Ruby on Rails web application for my university's department. For some of our resources in the web application, e.g. Project, are complex with their view layer logic: ...
0
votes
1answer
28 views

How to store the current version of an instance? Store reference to specific instance?

I'm working on a project with has different checklists (questions and answers) associated with an entity (Protocol). There is a business requirement to have these questions be altered in the future ...
1
vote
1answer
841 views

Pros and Cons of odd iframe 'architecture'

I'm in the process of experimenting with ways of breaking up a large (and growing project). Currently, we're working with a big Angular application with what will soon be a large number of components. ...
6
votes
4answers
822 views

Class design dilemma: Encapsulation vs Single Responsibility/Separation of Concerns

I'm working on a class that represents an object with multiple representations - one is an XML type representation used by an automatic ordering system, the other is a POJO-based representation used ...
0
votes
1answer
121 views

Should I hold an Id and the Item [duplicate]

Let's say I have a Customer which contains an Address class like: public class Customer { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; ...
3
votes
1answer
696 views

Could a view call a function of the model directly?

this is a fundamental question about MVC (in particular using AngularJS) and I've found similar questions here, but not the exact same problem: Could the view call a function of the model, or should ...
2
votes
0answers
62 views

Where to output from large CLI app [closed]

I've built a reasonably sized CLI app with everything split across different classes and namespaces in a logical way. However many components need to render output from within themselves. Which seems ...
3
votes
1answer
76 views

Can I resolve an issue with SRP, SOC that prevents object initialization via constructor?

In OOP, I can populate (initialize) an object using constructor injection at object creation time, or setter injection, after creation time. I like the idea of populating object at creation time via ...