2022 Developer Survey is open! Take survey.

Questions tagged [layers]

Layer (or abstraction level, or a layer of abstraction) is a way of hiding the implementation details of a particular set of functionality.

Filter by
Sorted by
Tagged with
0 votes
2 answers
93 views

Where should helper classes/methods for transforming business data for the View be located

I have inherited a badly architected and organised ASP.NET MVC application, which is an online booking system for healthcare providers. It seems to have been designed with very few object oriented ...
user avatar
0 votes
1 answer
112 views

In a layered architecture with exchangable data providers, how to deal with provider-specific implementation details?

Assume an application architecture with three layers (presentation, domain, data access - though presentation is irrelevant to this question) that follows dependency inversion: The domain layer ...
user avatar
  • 19
2 votes
1 answer
81 views

External dependencies in Domain Driven Design

The application I am working on is written in TypeScript and I need to manipulate DateTime. I always avoid doing date/time calculations manually, because they have a lot of edge-cases. The Date class ...
user avatar
0 votes
1 answer
107 views

Should I cache database requests made in validation layer?

Imagine an http request in a RESTful API that needs to request the database to perform validations before proceeding, but some of those database requests would need to execute again if the validation ...
user avatar
2 votes
3 answers
177 views

Handling exogenous exceptions in layered architecture

Exogenous exceptions are that kind of exception that are unavoidable because they are throwed outside of our system's pristine logic. A good practice is to throw wrapped exceptions in lower layers ...
user avatar
  • 21
-2 votes
2 answers
70 views

Creating new methods for every read query in Data Acess Layer

Lets say we have a table 'A' with 4 referenced tables : Table B,C,D,E In our Data Acces Layer we could write a method that returns Table A containg every entity of B,C,D,E by joining in order to reuse ...
user avatar
0 votes
1 answer
88 views

Understanding dependency inversion

According to the definition by Robert Martin, high level modules should not depend on low level modules, instead both should depend on abstractions. So if I have a domain entity Invoice that uses an ...
user avatar
  • 396
3 votes
2 answers
1k views

What layer do third party API request/response models go in and what do you call them?

I have a RESTful API service that has three layers: Application/Domain, Infrastructure, and Presentation. Application/Domain contain my interfaces and models. I currently have three different types of ...
user avatar
0 votes
2 answers
228 views

About layered architecture and the persistence layer

I’m pretty sure I’ve made some wrong assumptions in my questions so bear that in mind. At some point, the methods inside objects that are part of the persistence layer will be called/accessed for say… ...
user avatar
  • 23
-1 votes
2 answers
164 views

How to avoid CRUD and layered architectures in REST backends?

I'm creating a .Net 5 API backend and use EF Core for the database part. The simple CRUD way I know: API layer calling a command or query from the application layer using MediatR Application layer ...
user avatar
0 votes
2 answers
410 views

Patterns for returning messages/results from business logic to UI

Cross-posting from SO. Is there a name for the patterns used send messages/errors and results through an application's layers from business logic/database to the UI? What is the modern way? For ...
user avatar
  • 369
2 votes
1 answer
193 views

Which is a good way of separating and organizing layers and subdomains code, one that highlights and facilitates a clean architecture?

As I understand, when following the Low Coupling High Cohesion Principle, I should keep together the code that is related to same theme, splitting the code into modules/submodules by its "domain&...
user avatar
  • 129
0 votes
2 answers
124 views

Improving dependency inversion principle

Reading a little bit about Functional core & imperative shell pattern, I am wondering if the DI principle can be improved. What happen if instead of having an Infrastructure layer depending on ...
user avatar
2 votes
0 answers
378 views

How to retrieve login token from repository in network layer? Domain Driven Design - DDD

I am trying to come up with a design for an application I am working on. Here is a basic picture of what I am looking to do. Everything up to the Data Layer is totally fine but the Data Layer makes ...
user avatar
1 vote
1 answer
2k views

Repository Pattern with Services Layer - Good Practice?

This is my first time I am using repository pattern and applying a layered architecture in a project. I have followed the article found here. The complete code found on the article can also be found ...
user avatar
2 votes
3 answers
602 views

Is it an anti pattern to have service to service dependency in the layered architecture? [duplicate]

Is it a bad practice (or maybe anti-pattern) to have service to service dependency in the layered architecture? I've noticed that when an application is designed in a way that a service can call ...
user avatar
  • 129
0 votes
1 answer
89 views

Architecture Layers - Interface project at the top

We have structured our application with typical layers. UI, Database access, services, Helpers etc. However, at the very top we have a project called "Interfaces" which contains the ...
user avatar
  • 89
2 votes
1 answer
395 views

Moving authentication outside the domain layer

In discussion about an architecture decision that we do consider wrong and how exactly to address it, some lack of understanding on the matter arose. In dealing with authentication and authorization, ...
user avatar
3 votes
3 answers
253 views

Layered architecture horizontal dependencies

I'm working on a spring boot REST service. It's divided into three layers: REST controllers, services, persistence/DAO. We have multiple services and persistence repositories. We have the following ...
user avatar
  • 39
0 votes
2 answers
134 views

Inject an Operation ID across multiple application layers

I am playing with my simple personal project - a simple REST API application and I am currently struggling with a kind of design problem. The problem: How to insert an operation ID (request ID, an ...
user avatar
  • 54
1 vote
1 answer
107 views

Where to handle duplicate key exceptions in multy layer application

+-------------+ +--------+ +----------+ | repository +-------->+service +------->+controller| +-------------+ +-^------+ +------------+ +-------------+ | ...
user avatar
0 votes
1 answer
78 views

Problems with software layers in complex query methods

I designed a rest api software with 2 simple layers: Controller and Service. The controller handles the coming http request and redirect to a service method. In the beginning of development every was ...
user avatar
1 vote
3 answers
292 views

In a layered architecture, is a domain object sent 'up' to the ui layer so that the ui layer can display the fields that are in the domain object?

I'm learning about the Layered Architecture Pattern for Software Development but I'm confused on how objects are sent 'up' the layers. In general, I know that there are about 4 main layers: ui layer, ...
user avatar
  • 27
0 votes
1 answer
908 views

Decouple business logic from DTO

I've to implement some Backend Webservices, which provide a given, final JSON structure, which is allready in use on the FrontEnd side. This structure doesn't match the database structure, so I have ...
user avatar
1 vote
2 answers
74 views

When using data and domain models, where should validation take place? And how should errors be fed back to the user?

When using data and domain models, where does validation take place? Both or just For example: class UsersDB(): def create(self, user_data): # Create user here return ...
user avatar
  • 51
3 votes
2 answers
1k views

Uncle Bob's Clean Architecture - Dealing with anemic interactors, tiering, and front-end MVVM

Background In Uncle Bob's Clean Architecture, use case interactors are responsible for the orchestration of business objects to accomplish some user goal. As an easy example, an e-commerce application ...
user avatar
7 votes
3 answers
6k views

Domain vs Entities model? Domain-Driven-Design (DDD)?

In this github, https://github.com/johnph/simple-transaction, under the Transaction.Framework project, there are entities (located at Data/Entities) AccountSummaryEntity.cs AccountTransactionEntity ...
user avatar
  • 299
5 votes
1 answer
452 views

Is My Data Access Layer Really My Domain?

I'm not an architect, but am trying to put together a diagram which represents the architecture of the application which I am maintaining. I have one question (but welcome any comments about the ...
user avatar
-1 votes
1 answer
135 views

How shall I implement a MVC program into presentation, business logic and data access layers?

Here is part of an ASP.NET MVC program, from https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/controller-methods-views?view=aspnetcore-3.1 : A model class Movie: public class ...
user avatar
  • 5,271
1 vote
2 answers
674 views

Layered Model-View-ViewModel design

I am designing an application using C# and Windows Presentation Foundation (WPF). I would like to follow (at least) the very basic rules of software architecture, like dependicies only going in one ...
user avatar
2 votes
2 answers
88 views

Mantain same entity data in different layers

I'm trying to split the use of a business entity (e.g. a post) thought an application uses, trying to obtain a clean architecture So I will likely have: A class model, where the business logic lives ...
user avatar
2 votes
1 answer
148 views

What should I name this area of my architecture?

I am developing an architecture for a new MVC system. The legacy system has a layer it calls "facade", but it is not the classic GoF Facade. It is more like a service aggregator. It is used as a ...
user avatar
0 votes
2 answers
2k views

Unit Testing business logic layer that depends on data access layer [duplicate]

a discussion that rose among us devs: how to do unit test of Business logic layer that depends on data access layer. the two options are create test data in a test database (for example, H2). let the ...
user avatar
1 vote
3 answers
299 views

which layer must check if something(like account etc) exist in database

I am implementing a web api and i have crated three layers,data access layer,business layer and presentation layer. In data access layer I have a method which create a user.I use a transaction which ...
user avatar
  • 111
2 votes
2 answers
101 views

Where should objects be built from view-models in a layered architecture?

Having the following classes: Person.cs namespace Project.Domain { public class Person { public int Id { get; set; } public string Name { get; set; } public decimal ...
user avatar
-3 votes
1 answer
73 views

Packaging of a web application code-base [closed]

Michael Nygard writes in Release It!: Have you ever checked in a commit that had bunch of new files like "Foo", "FooController", "FooFragment", "FooMapper", "FooDTO", and so on? That is evidence of ...
user avatar
  • 211
2 votes
2 answers
729 views

Check permissions on top layer before going deeper

I'm building a four layer simple architecture with the following layers: Controller Actions and Events Repositories, that returns single entities or collections Models, where the SQL code resides ...
user avatar
1 vote
0 answers
217 views

Is ASP.NET Core Identity a leaky abstraction?

As far as I know, the DBContext or underlying persistance technology should be only contained inside the Data layer. Also, it feels very wrong to me to have identity package inside the user ...
user avatar
3 votes
0 answers
52 views

Scalable QT/ C++ Architecture advice

I am working on software which supports different hardware device generations. With each software release all device generations are supported, what means that each device generation is also tested. ...
user avatar
  • 31
1 vote
1 answer
165 views

Message passing interface between protocol layers

Let's imagine a custom network application having 3 protocol layers. Layer A is the top-level protocol and layer C is the lower level protocol. Each layer has its distinct functionalities. These ...
user avatar
  • 135
4 votes
0 answers
537 views

Understanding layered architecture: are these layers in a Nestjs application really decoupled?

I'm creating a new project usin Nestjs, which I'm really starting to like. I cannot figure out though, what the right way is for separating Business layer and Application layer. Following the ...
user avatar
  • 141
27 votes
5 answers
14k views

Which layer do DDD Repositories belong to?

In his DDD book Evans promotes the idea of layered architecture, and in particular that the business logic should be confined to domain layer and separated from UI/persistence/other concerns. He also ...
user avatar
  • 1,099
0 votes
1 answer
88 views

Questions about Direct access to data source from Services

Background: I'm trying to separate my concerns in the application architecture the best possible way. In a nutshell: The requests are parsed and go to an Action Action decides which service(s) to ...
user avatar
2 votes
1 answer
292 views

Two-level concepts

I find myself lately implementing the same concept twice, once at a low level and once at a higher level. Let me see if I can explain it... For example, given the notion of a database, I have one ...
user avatar
0 votes
1 answer
139 views

Generic crud with jdbc api

I am used to programming java on the server side with ORM frameworks and using abstract classes for CRUD. But now I'm workign on a desktop project without ORM and just the good old JDBC API for ...
user avatar
0 votes
1 answer
99 views

Communication between separated application parts

I have searched well before asking this question, and some of the questions look like what I need here, but none of the gave a clear answer to my question. I am writing a web application (in PHP if ...
user avatar
14 votes
3 answers
2k views

Is it problematic to have a dependency between objects of the same layer in a layered software architecture?

Considering a medium-big software with an n-layer architecture and dependency injection, I am comfortable to say that an object belonging to a layer can depend on objects from lower layers but never ...
user avatar
  • 379
0 votes
1 answer
471 views

How to properly decouple the service layer from the user interface layer, if the service layer needs to interact with the user?

In my program, I have a long-running function from which I would like to interact with the user for various reasons: Giving status updates ("Downloading file /foo/bar.png") Displaying warnings ("File ...
user avatar
  • 245
1 vote
1 answer
67 views

Adding Security Layer for multiple services

My web application at the moment accepts REST requests and handled via some controllers, which calls corresponding services to perform the logic. Now I want to add in some security logic before ...
user avatar
3 votes
3 answers
5k views

Business Logic Entities and Data Access Layer Entities

I am thinking on how to structure a project. I wonder if it is a good practice to use different entity classes between the BL and DAL in order to decouple these layers. I have worked on projects ...
user avatar