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
3
votes
2answers
670 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 ...
3
votes
1answer
699 views

OOP - How to refactor a “pyramid architecture”

Unbeknownst to me while I was building it, I built a "pyramid" architecture. I did not realize this until I laid it out in my new Visual Studio 2013 Layer Diagrammer. Each layer depends on the layer ...
3
votes
3answers
952 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 ...
3
votes
1answer
718 views

Where do utility libraries fit in a layered architecture?

Consider this mock-up of a software stack designed with layered architecture in mind : Every application layer is decoupled through API calls, but a memory handling library is used throughout. All ...
3
votes
3answers
238 views

Abstracton layer to control services access to denormalized db entity

Our db is optimized for minimum join count (partially denormalized). E.g. our User entity contains account data (nickname, facebook id, etc), user numerical statistics (total games played, total wins, ...
3
votes
1answer
423 views

Why doesn't layered architecture translate easily to tiered architecture?

Basically, I'm trying to understand why layered and tiered are that different, and why they don't translate easily to each other. I understand that layered could be 3 separate class files for UI, BL ...
3
votes
1answer
3k views

What are “User Process Components”?

This article about application architecture design mentions "User Process Components" as part of the presentation layer. User process components. Your user process components help synchronize and ...
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 ...
3
votes
4answers
781 views

N-Layer architecture

I am attempting to structure my solution projects in such a manner as to improve testing, reuseability, separation of concerns and all that good stuff. Whilst I understand these concepts in theory, I ...
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. ...
3
votes
0answers
86 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
1answer
296 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. ...
3
votes
0answers
585 views

Refactoring to avoid circular references

I'm working on an ASP.NET MVC solution that has two projects, WebUI and DAL. WebUI references DAL. DAL has the repository and context, while WebUI contains Authentication and Authorization classes. ...
2
votes
1answer
104 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
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 ...
2
votes
3answers
207 views

Efficiently “moving” data upward through a communication stack

I have implemented an application protocol stack that moves an incoming stream of data upward through several layers, as follows: copies a TCP segment from an OS buffer to my_buffer. after ...
2
votes
2answers
331 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
3answers
893 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 ...
2
votes
2answers
598 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?
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
2answers
2k 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 ...
2
votes
2answers
663 views

Do web applications use HTTP as a transport layer, or do they count as an integral part of the HTTP server?

Given an HTTP server (e.g. Apache, IIS) and a web application (user code running in the server using PHP, ASP.NET and the likes), which of those can decide which HTTP status code to return for any ...
2
votes
2answers
75 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 ...
2
votes
3answers
1k 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 ...
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 ...
2
votes
1answer
526 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 ...
2
votes
1answer
100 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
73 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
2answers
2k 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
721 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. ...
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 ...
2
votes
1answer
297 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
127 views

How to handle errors best addressed in a higher abstraction layer and dependent on state inferred in current layer?

I have a use-case that can be repaired, but the logic for repairing it is best done in a higher level of abstraction. Just throwing exception/failure is ugly because it's hard to pass back up through ...
2
votes
1answer
289 views

When do domain concepts become application constructs?

I recently posted a question regarding recovering a DDD architecture that became an anemic domain model into a multitier architecture and this question is a follow-on of sorts. My question is when ...
2
votes
0answers
242 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 ...
2
votes
2answers
258 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 ...
1
vote
3answers
6k views

PHP - Data Access Layer

I am currently reviewing a code base and noticed that a majority of the calls (along with DB connections) are just buried inside the PHP scripts. I would have assumed that like other languages they ...
1
vote
4answers
771 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 ...
1
vote
2answers
131 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 ...
1
vote
1answer
2k views

Entity Framework and “ViewModel”

Earlier I asked a question about "Entity Framework and layer seperation" and found out that some people use a ViewModel to show their data in the UI. For example if we got a "Person" table and an "...
1
vote
2answers
1k views

Where should the “not empty field” validation code be written on a 3-layer application?

When working with the 3-layer model, where should the validation code be placed? for: not empty fields, unchecked options, null values, wrong-written dates, etc. To keep total isolation between a ...
1
vote
1answer
136 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
158 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 ...
1
vote
1answer
242 views

Data Access Layer for application

I am working on a retail application where currently I'm using raw SQL like insert into some_table values (Textbox1.Text, Textbox2.Text, ...) and update some_table set some_column = value for ...
1
vote
3answers
4k views

Business Logic vs Presentation/View Logic

I often question myself of where to put the logic that organize the data to a view that is not necessarily a business logic in a 3-layered architecture (DAO, Business, View). I'll put an example to ...
1
vote
3answers
1k views

Recommended content for layers

As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions I now wish to know if I am putting the right functionality in ...
1
vote
1answer
63 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 ...
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 ...
1
vote
1answer
334 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
6k 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<...