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 [layers]

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

0
votes
0answers
20 views

Distribution of entity operation across DA and Service layer

I have a JPA entity A which has an attribute position that specifies the ordering, e.g. @Data @Entity public class A { @Id private Long id; @Column private Integer position; } Now I want to ...
2
votes
3answers
80 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
0answers
40 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 ...
1
vote
1answer
104 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 ...
-1
votes
1answer
43 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
34 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 ...
3
votes
1answer
73 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 ...
0
votes
0answers
80 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
90 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....
1
vote
1answer
84 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
0answers
72 views

Business Logic: 3-Layer-Architecture and Rich Domain Model

I have some questions about the "best" underlying architecture of software projects. I know, that there are different similiar posts but I'm really confused because it seems that everybody is telling ...
0
votes
1answer
101 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
2answers
155 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 ...
2
votes
1answer
198 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 ...
1
vote
1answer
93 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 ...
4
votes
3answers
124 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 ...
2
votes
2answers
192 views

Disadvantageous of using entity framework layer directly into presentation layer (ASP.NET MVC) by skipping Service layer

In my company, We are planning to build more than one web application on a single Database. The proposed design of each of these apps are - ASP.NET MVC as Presentation layer, Restful API as service ...
2
votes
1answer
72 views

Decouple service complex query building from datastore

We have a very large search service (written in golang if it matters) that runs on top of ElasticSearch, receive requests, builds the correspondent query, and returns the results (with some post-...
2
votes
1answer
68 views

Cross Entity Action Implementation

I have a domain layer, which my application architecture holds "sacred"; that is to say, the domain layer has no references to either data storage, or presentation concerns (vice-versa is allowed). I ...
1
vote
3answers
529 views

Does layered architecture still to be implemented inside all other architecture pattern like SOA and Microservices?

When we design the whole system we have few architecture pattern to select from. One of them is the layered architecture pattern, This pattern seems to be generic enough to fit in all other ...
3
votes
2answers
286 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(); ...
-3
votes
1answer
67 views

What to call a API and DB code layer [closed]

In a recent MVVM mobile app project I wrote a set of API classes and Database classes where there was a clear flow of logic between both api and db code. To enforce the way api and db interacted I ...
0
votes
2answers
327 views

Multiple layers of abstraction and chain calls of methods (Java functional like programming)

I am creating a multiple wrappers/layers API in Java that go like this public class Layer1<T extends Layer1> public class Layer2<T extends Layer2> extends Layer1<Layer2> public ...
0
votes
0answers
1k views

Pattern for DTO/Assembler

I am working on a CRUD application in Java (DropWizard). I chose a pretty typical layered architecture with the following layers: Domain Layer (Entities, DAOs), Application Layer (Services) and ...
1
vote
2answers
263 views

A way to keep object between layers decoupled?

I think this is a common design problem, but I keep scratching my head every time I face it. On one side, we have our API which sends or receives simple structures aimed to be consumed by web apps, ...
0
votes
2answers
167 views

Where to put code for XML Deserialization: Business Logic Layer or Data Access Layer?

I have a web application (ASP.NET Core / C#) with 3 layers (web/presentation, business logic and data access). I'm using Entity Framework to retrieve a record from an SQL Server database which is ...
3
votes
3answers
566 views

An alternative to a 3-layer-architecture?

At work, a 3-layer-architecture is the go to whenever a web application is needed. I don't mind this, but many of the applications we start, do not seem to have an initial need for this. These ...
1
vote
1answer
2k views

What is the best way to get a list of Business objects from a list of entities?

I am using entity framework to get a IEnumerable<CustomersEntity>, and I need to cast this to a IEnumerable<CustomerBO> to display it in some view. I know how to do cast a IEnumerable<...
0
votes
1answer
64 views

What is the correct way to design a model and its relations?

I have the following database models and its properties: User (id, role_id, name, email, password) Role (id, name, description, active) User2Role (user_id, role_id) Customer (id, name, user_id) A ...
2
votes
2answers
702 views

Where and how to handle Unique column constraints

I want a non-primary key column to be unique. This is enforced with a unique constraint. In a service endpoint I want to return a nice error message structured into a {field, messsage} object when ...
2
votes
1answer
504 views

Dependecy Injection and Composition Root

Just recently started to grasp on MVC and design patterns. (back to school at 34 ;) ) I was asked by my teacher to design a two part application. It's a recipe website that as an admin WinForms app. ...
5
votes
1answer
183 views

Should I retrieve related entities from the parent entity or the service layer?

Let's say I have a three tier application structure, with Presentation, Service and Data layers. The data layer is managed by an ORM and has two models/entities, Show and Episode, with a one-to-many ...
2
votes
1answer
113 views

How to make associations security proof

When designing an application I usually stumble upon a problem I've never quite managed to handle properly. Suppose you have Products and Orders. Usually in my data-access layer I have repositories ...
2
votes
3answers
1k 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 ...
0
votes
1answer
406 views

3-tier data access layer usage

As I understand in the 3-tier architecture, the presentation layer talks to business logic layer, which talks to data access layer. And, ideally, business layer knows nothing about presentation, and ...
0
votes
2answers
1k views

How To Design BLL in ASP.NET MVC

I'm trying to design a N-Tier Solution for my existing WebAPI project. I have a WebAPI project where, as of now, all the business logic are written in the controllers and the data validation are done ...
3
votes
2answers
1k views

Pattern for a method call outcome

Most often I need to call a service method from a controller, and based on the outcome, if there's an error show an appropriate error message depending on the error (or some other action, showing ...
5
votes
2answers
182 views

How do I know when to refactor global database query calls, and when to leave them alone?

I have the following global statement calls sprinkled throughout my PHP legacy codebase: $jobnumber = db_quick($sql); db_query($sql); That is, those function calls have been initialized in the ...
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 ...
4
votes
1answer
1k 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 <...
6
votes
2answers
507 views

What is a good reason for separating intelligence and dao layers in a microservice?

I am having a long-term debate with my architect about architecture choices. The entreprise where I work in is migrating from a monolithic architecture to a microservices one. The debate is located ...
0
votes
1answer
482 views

What layer does the presenter go in?

Whereas there seems to be a lot of information on the Internet about what the presenter both is and does, there doesn't seem to be a whole lot that specifically describes where to put it in a multi-...
1
vote
0answers
94 views

JavaFX generating UI controlls from backend classes

I have a problem with my Software design. I want to generate UI controls from XML messages over the network. The XML messages contain simple information about a component and its properties for ...
2
votes
2answers
316 views

In which layer should sorting logic exist

I have an api with 3 layers 1.) The endpoint layer which exposes api endpoint handler functions. These generally call the business layer, aggregate the results to form an http response. 2.) The ...
5
votes
1answer
217 views

Globally interesting state in angularjs

I've created maybe five services like RoleService, AuthService, etc. Each of them has some state (e.g., RoleService.role, AuthService.isLoggedIn) affecting a lot of controllers and some other services ...
0
votes
1answer
2k views

Help me resolve this circular dependency?

This would be behind a spoiler tag if I could get the markdown to work. Sorry. As soon as I typed in "circular dependency", I got a ton of suggested results. Such as: How to handle “...
2
votes
3answers
651 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 ...
1
vote
2answers
143 views

How to abstract DB access and yet support flexible filtering?

I have a need to implement REST API which would support a complex filtering, so user would be able to make such requests: Products?$filter=Price le 3.5 or Price gt 200 The API server will use a ...
0
votes
0answers
261 views

How do I design a Service Layer in code?

I am currently rewriting one of my projects in Java and want to implement a service layer that will be used by different clients (CLI/GUI/Web) to communicate with my core application. For now it will ...
1
vote
0answers
151 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. ...