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
1
vote
2answers
60 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 ...
0
votes
1answer
71 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 ...
2
votes
2answers
91 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 ...
5
votes
4answers
2k views

DDD, modularizing the application and domain layers without breaking the DIP

Quoting DDD theory: The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects to perform the actual work. When it comes to modularization, and ...
4
votes
2answers
485 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 ...
5
votes
1answer
164 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 ...
1
vote
2answers
106 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 ...
-1
votes
1answer
59 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 ...
0
votes
0answers
42 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 ...
2
votes
2answers
76 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 ...
1
vote
1answer
138 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 ...
1
vote
2answers
168 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 ...
2
votes
2answers
92 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 ...
-3
votes
1answer
69 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 ...
3
votes
1answer
311 views

Maintaining consistency with loosely coupled business and data layers

Take the following sequence of events: Business layer requests data x and y from data layer. Data layer returns version 1 of x and y. Business layer starts performing logic based on data x and y. ...
1
vote
2answers
123 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 ...
0
votes
0answers
99 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 ...
3
votes
0answers
42 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. ...
1
vote
1answer
65 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 ...
3
votes
0answers
107 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 ...
3
votes
4answers
1k 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 ...
4
votes
2answers
643 views

How is layer between MVC controller and back-end called?

I have ASP.NET MVC application with the following controller and action: public class AccountsController { public ActionResult Index() { var accounts = _accountsManager.GetAccounts();...
0
votes
1answer
43 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 ...
11
votes
1answer
7k views

Onion architecture vs 3 layered architecture

I see only benefits to the onion architecture over the 3 layered architecture where the BL had responsibility to call methods on DAL (or an interface of DAL) to do CRUD. The onion has better ...
2
votes
1answer
289 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 ...
2
votes
1answer
316 views

How to use ViewModels in a layered architecture?

I've got a Java application that is using a layered architecture, we have: presentation layer, business layer and data access layer. Our business layer uses the models to process the "requests". We ...
2
votes
1answer
545 views

DDD: Should create domain model for complex application layer?

I'm midway through Eric Evans' DDD book but don't think this question would be answered in the book. If an application has its own complicated concepts different from the underlying domain, can we ...
0
votes
1answer
91 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 ...
12
votes
4answers
656 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 ...
3
votes
3answers
2k views

Java Interfaces in Layers pattern

I'm developing a Java software according to the object-oriented Layers architectural pattern. Every layer should be clearly separated from the rest, and provide a well-defined interface to use it's ...
405
votes
12answers
152k views

How accurate is “Business logic should be in a service, not in a model”?

Situation Earlier this evening I gave an answer to a question on StackOverflow. The question: Editing of an existing object should be done in repository layer or in service? For example if ...
3
votes
3answers
3k 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 ...
2
votes
2answers
283 views

How to correctly split a monolith and rely on the same domain

Context I'm developing a Spring Boot java application. Currently it is a monolith with the rest API and the front end (vaadin driven) in the same big project. Although this is very easy to develop ...
0
votes
1answer
317 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 ...
1
vote
1answer
52 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 ...
2
votes
0answers
253 views

N-Tier/Layered Architecture with MVC

Do N-Tier/Layered architecture really helpful with MVC? I have some projects here that use N-Tier architecture with MVC. The available layers are Entity Layer Data Layer Business Layer Presentation ...
4
votes
1answer
252 views

In an asp.net mvc application, can I use Entity layer as Model?

I am developing an asp.net mvc solution, which contains the three layers: Data Access Layer Business Layer Entity Layer Each layer is a project. I have developed the controllers and views, but no ...
1
vote
1answer
120 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 ...
-2
votes
1answer
499 views

Consuming Rest, DAO or Service layer?

I feel like this is a dumb question but here it goes: If i'm consuming rest (getting data and transforming in POJO), does it sit in the DAO or Service layer? As for what i've researched I believe that ...
0
votes
1answer
49 views

Function for processing files: Business Layer, Service Layer, or anything else?

I read that Repositories should not refer to other repositories. I have a method ProcessFile that refers to multiple repositories, it parses a file, and inserts into many table models in different ...
0
votes
0answers
264 views

Clarification on the Onion architecture's Domain Service and Application Service

I am studying Onion Architeture but i got some doubts: All the samples (github) I found over internet are too simple, or are implemented under DDD (which I have not studied at the moment) so I can ...
1
vote
1answer
106 views

Software layers and data mapping

Before I would ask my question, here is the context: I am working on one part of a relatively big software. In its simplest form there are 3 layers of the software lets call them lower layer, middle ...
1
vote
1answer
362 views

Where to convert int to enum in a 3-tier architecture?

I have a situation where a DB field is storing an enumeration value whose underlying type is int, so I'm getting back values like 0, 1, and 2, which should represent MyEnum.Foo, MyEnum.Bar, and MyEnum....
8
votes
1answer
3k views

How is transactionality implemented in DDD applications?

I have been searching and reading recently about DDD and, so far, I think I understood its fundations. If I understood well, the architecture is similar to this: Database <--SQL--> DAO/ORM <...
0
votes
1answer
319 views

Why are the Android runtime and native libraries in the same layer?

Regarding the diagram in Android's website: https://developer.android.com/guide/platform Why did they put the Android Runtime category in the same layer as the native C/C++ libraries category. ...
1
vote
1answer
197 views

Data transfer between modules (layers)

I'm creating an application that is composed using different modules (core, course, grades, news). I'm using clean architecture for the different modules but I'm stuck trying to pass data from one ...
5
votes
2answers
935 views

Relaxed architecture DAL or anemic BLL?

Particularly for the sake of unit testing, I'm trying to implement an application with a layered architecture. I'm coding in C# and using ASP.NET Web API for the service layer. I'm aiming at a 3-layer ...
4
votes
3answers
217 views

Does Presentation Logic constrain design of Business layer?

We have an email plugin which encrypts a mail's attachments when the user sends an email and gives the mail's recipients permissions to decrypt the attachments. The recipient permissions are stored on ...
47
votes
3answers
37k views

Uncle Bob's clean architecture - An entity/model class for each layer?

BACKGROUND : I'm trying to use Uncle Bob's clean architecture in my android app. I studied many open source projects that are trying to show the right way to do it, and I found an interesting ...
6
votes
2answers
2k views

When is a Use Case layer needed?

In his blog post The Clean Architecture Uncle Bob suggests a 4-layer architecture. I understand the separation between business rules, interfaces and infrastructure, but I wonder if/when it's ...