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
2
votes
1answer
654 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
282 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
251 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
380 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
110 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
75 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 ...
2
votes
3answers
2k 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 ...
5
votes
2answers
830 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();...
-2
votes
1answer
78 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
894 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 ...
1
vote
2answers
1k 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
383 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
1k 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
7k 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
65 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
3k 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
774 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
320 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
115 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 ...
3
votes
3answers
3k 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
732 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
2k 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 ...
2
votes
2answers
3k 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 ...
4
votes
2answers
267 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 ...
7
votes
1answer
2k 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 ...
11
votes
2answers
5k 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 <...
7
votes
2answers
970 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
774 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
108 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 ...
3
votes
2answers
941 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 ...
6
votes
1answer
232 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
12k 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
969 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
164 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
557 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 ...
3
votes
1answer
428 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. ...
8
votes
4answers
5k views

What layer should contain interactions with external or remote resources which are not strictly data operations?

Assume an application with a layered architecture, i.e. presentation, business/domain/logic, data access: it makes sense to plug access to external APIs in at the data layer if what they do resembles ...
12
votes
1answer
9k 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 ...
4
votes
2answers
1k views

Layered architectures and modular software

I have built a server-side Java application of about 10k lines of code and on a code review a colleague made me notice that when developing a new business feature , I have to touch several files. My ...
2
votes
1answer
105 views

Can I manage transactions in the UI

Do I need an "application/service" layer to manage transactions if the domain layer only services the UI? In other words, can't I just manage transactions in the UI when I have only one consumer of ...
2
votes
2answers
767 views

Domain object using DAO within a transaction

Is it considered good practice to start a transaction in the "service/application" layer, and then have objects in the domain model make DAO calls which participate in that transaction?
5
votes
3answers
1k views

How can you separate a monolith into domain-driven libraries without duplicating interfaces and still keep dependencies simple?

I'm working on a project with web services, and I've been structuring things where: The web service contains the business logic layer A library which handles the data access layer I've recently been ...
5
votes
2answers
1k 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 ...
0
votes
1answer
167 views

Best practices for internationalization in layered applications

I'm building a new application in JSE for which I want to support internationalization. I've never built such an application. I'm looking for the best practices for internationalization. The ...
0
votes
1answer
196 views

Using static methods in layered architecture

In layered architecture does it matter where static methods go? Or is it the architect deciding this? For example can the DAL be static to cache records and perform smart data retrieval at the ...
5
votes
2answers
285 views

Save Two Different Domain Objects in One Service Call

Think that when one Branch saved, a Customer entity must created in n tier layered system architecture. All validation has already implemented in CustomerService. Should BranchService create ...
1
vote
1answer
818 views

Layer application and token authentication

Suppose we have an application with multiple layers in .Net: Domain layer (entities) Data access layer (entity framework) Business layer Web Services layer (Web Api) Presentation layer (MVC) Now I ...
2
votes
2answers
1k views

Integrating Logging Library into multilayer Object: What is a good structure?

I am integrating Serilog into and existing multilayer library that I've create. The previous logging technique I used was simply passing a string up the layers with events. I'd like to get away from ...
7
votes
1answer
319 views

MVC - Do I create 'joint' layers when dealing with multiple models?

I'm new to MVC and the different layers architecture and this is what I have currently: 2 models: User, Company 2 service layers: UserService, CompanyService 2 interfaces which abstract the ...
5
votes
1answer
274 views

Choosing between Dependency Inversion and Dependency “Delegation” to a third module

Suppose I have MasterPackage containing a Master class, and BlasterPackage containing Blaster class. Since Master needs a Blaster to work, the higher level MasterPackage depends directly on lower-...