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

learn more… | top users | synonyms

0
votes
0answers
89 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 ...
0
votes
0answers
44 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
1answer
68 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
4answers
135 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 ...
235
votes
11answers
70k 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 ...
1
vote
1answer
90 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 ...
0
votes
1answer
165 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
111 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 ...
35
votes
5answers
7k views

Do stored procedures violate three-tier separation?

Some colleagues of mine have told me that having business logic in stored procedures in the database violates the three-tier separation architecture, since the database belongs to the data layer ...
2
votes
1answer
87 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 ...
0
votes
2answers
49 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?
4
votes
3answers
102 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 ...
6
votes
1answer
206 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
69 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
0answers
20 views

Where to store authentication/authorization entities with respect to crosscuting concerns?

Can you explain me how and where to store authentication/authorization entities in project structure. For example I have 4 projects in my solution in Visual Studio: SolutionName.WebApp SolutionName....
0
votes
1answer
52 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 ...
0
votes
0answers
102 views

SQL/HQL in a Play framework controller and Service Layer pattern

I started using the Play Framework a couple of months ago. It "redefines" many conventions from the traditional Java world (like the way of using static methods among other things). I was browsing the ...
0
votes
1answer
61 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 ...
0
votes
0answers
41 views

Code architecture for separate apps facilitating the same process

So I am at a cross roads with deciding on my integration strategy for a few of our business apps that play a role in a larger process. Being the only developer and never having to do this before leads ...
6
votes
1answer
231 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 ...
3
votes
6answers
1k views

Domain Model, validation, and pushing errors to the model

Looking into DDD and something I noticed is that business logic should be in the model, otherwise you just have property bags. That said how do you handle pieces of validation that require a trip to ...
0
votes
0answers
152 views

Is this approach scalable?

I am working to rewrite a legacy application (C++) to C# ASP.NET MVC with EF6 but plan to upgrade to ASP.NET Core1 and EF Core 1. The database schema is really arcane in that it has a single schema ...
5
votes
1answer
108 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-...
3
votes
3answers
169 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, ...
4
votes
1answer
90 views

Testing of a layered software architecture

I am currently building an application with a layered architecture in C. Currently, I have built and tested the bottom layer, which is a networking module, providing functionality such as connecting/...
8
votes
3answers
738 views

Implementing a complexity hiding layer

As part of the dependencies that the project I'm working on has, we use several core services. These services, to which we can't make big changes, are a big mess. Depending on the method we invoke, we ...
1
vote
1answer
32 views

Can an outside component interact with lower layers directly in a strictly layered architecture

If we have a strictly layered architecture, can we allow outside components to interact directly with the lower layeres? More specifically: In my lower layers, I am providing a service, and in the ...
0
votes
2answers
261 views

In AngularJS - should $resource be used from controller or service?

All the documentation, examples and tutorials I've found on $resource were using it directly in the controller. So far I'm just using $http from services and those services are further used in the ...
3
votes
0answers
192 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. ...
5
votes
2answers
260 views

Where should business logic go in a layered architecture?

First of all, i'm not talking about validation in the sense of the nullability or length of a field like in this and this questions where we can use isValid() methods in business classes or an ...
11
votes
3answers
15k views

Entity Framework and layer separation

I'm trying to work a bit with Entity Framework and I got a question regarding the separation of layers. I usually use the UI -> BLL -> DAL approach and I'm wondering how to use EF here. My DAL would ...
3
votes
4answers
279 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 ...
1
vote
1answer
1k 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 "...
3
votes
1answer
405 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 ...
1
vote
2answers
180 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 ...
4
votes
3answers
1k 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 ...
0
votes
3answers
1k 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 ...
3
votes
3answers
4k views

Presentation VS Application layer in DDD

I have trouble drawing a clear line between Presentation and Application layer in Domain Driven Design. Where should Controllers, Views, Layouts, Javascript and CSS files go? Is it in the ...
0
votes
1answer
1k views

Trying to understand 3 layer programming [closed]

I am confused to understand the structure of a 3 layer programm. Where is good place for exceptions, entity and etc.? If I use MVC, in my UI model, how to transfer entity class to model class and etc.?...
0
votes
2answers
121 views

What layers reference each other in a multi layer design? [duplicate]

I'm creating a project and I'm having difficulty and contrasting opinions on how to do things when it comes down to separating layers. I'm not fully sure what layers should reference each other. I ...
1
vote
2answers
272 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
233 views

Confused about layered application development

So, for the first big project that I'm getting paid for, I decided I'd do things right. To that end, I've created several projects in my Solution. Some of these projects are generic and handle common ...
0
votes
2answers
359 views

Can a layer consist of multiple projects / dlls?

I am working on the architecture for a new web application and I am pretty much a complete newbie when it comes to architecture. Working my way through .NET Application Architecture Guide, 2nd Edition ...
2
votes
1answer
108 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 ...
1
vote
1answer
334 views

Lazy Loading, DAL and BLL abstraction

I'm asking myself a question to code the right way on a new fresh project. I have a designed database and I mapped tables to equivalent POCO classes using Entity Framework 6 Code First. Then, I ...
3
votes
1answer
204 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 ...
4
votes
2answers
397 views

What are the advantages of strictly maintaining separate data | algorithm | interface layers?

I always separate the user interface from other functionality in my programs - its the way I have been taught, and it has obvious advantages since you can change the interface but keep the same ...
3
votes
2answers
220 views

Best practice for security checks, in surface or deep layer? [closed]

Let's take a server-side WebServices app, we need to make sure that all function applies every security rules, and keep the code clean. In such a case, I usually prefer to place my security checks on ...
1
vote
1answer
144 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 ...
62
votes
13answers
6k views

Why is it a good idea for “lower” application layers not to be aware of “higher” ones?

In a typical (well-designed) MVC web app, the database is not aware of the model code, the model code is not aware of the controller code, and the controller code is not aware of the view code. (I ...