Questions tagged [service-layer]

A Service Layer represents one application boundary and consists of a set of available operations from the perspective of interfacing client layers. It encapsulates the application's business logic, controlling transactions and coordinating responses in the implementation of its operations. In enterprise OOP it is often the glue between an application's Model/Data Layers and its Presentation Layers.

A Service Layer represents one application boundary and consists of a set of available operations from the perspective of interfacing client layers. It encapsulates the application's business logic, controlling transactions and coordinating responses in the implementation of its operations. In enterprise OOP it is often the glue between an application's Model/Data Layers and its Presentation Layers.

This excerpt was heavily borrowed from Martin Fowler's book - http://martinfowler.com/eaaCatalog/serviceLayer.html

395 questions
0
votes
0 answers

What is the best way to instantiate service layer classes?

I've been using laravel for a long time. However, I need better the way I structure my projects. Sorry for my english, I'm from Brazil. the structure of my project is: router -> controller -> Service -> Repository -> Model. I place all application…
Jobsdev
  • 1,047
  • 3
  • 11
  • 28
0
votes
0 answers

Mvc simple dependency injection from service layer to data layer (three layer application)

I have to rewrite an old asp classic web application. I chose an architecture in three levels (tier/project = layer level) Web: views and controllers, thin as much as possible. References service layer project. Service: business logic. References…
albe
  • 139
  • 1
  • 1
  • 12
0
votes
1 answer

Code Separation in Service Layer and Controller

I have written code for reset password and other parts of my application, I want to separate service layer from dao and controller; my controller code is: @RequestMapping(value = "", method = RequestMethod.PUT) public ResponseModel…
AHS441
  • 144
  • 1
  • 2
  • 13
0
votes
0 answers

Model objects for DAO pattern and service layer

Say I have the following tables in a database with a one to many relationship: Television Columns: id(PK), description, model, brand_id(FK), type_id(FK) Type Columns: id(PK), name To represent a Television I can create the following model…
Guybrush
  • 256
  • 4
  • 16
0
votes
2 answers

Question about Interfaces and DI?

I am using the Service/Repository/EF/POCO pattern in a MVC app, and had a couple questions about the Interfaces. 1) Should I make an Interface per Service? 2) Should I make an Interface per Repository? Or, should I have a generic interface per layer…
Sam
  • 15,336
  • 25
  • 85
  • 148
0
votes
4 answers

UnitOfWork and Separation of Concerns?

I am using the UnitOfWork/Service Layer/Repository/EF4 w/POCO design in my MVC app. So far I have this: 1) MVC Web App (Project.dll) 2) Service Layer (Project.Data.Services.dll) 3) Repository Layer (Project.Data.Repositories.dll) 4) POCOS…
0
votes
1 answer

Alternative way for Throwing UserFriendlyException and Exception Handling for Business Rule Validation

Considering the cost of throwing exception, an alternative way is something like this: public interface IValidationDictionary { void AddError(string key, string message); bool IsValid { get; } } public class ModelStateWrapper :…
user5709087
0
votes
2 answers

ASP.NET MVC/Service Layer/Repository/EF4/POCO - Am I thinking right?

I have been working on a new ASP.NET MVC application and trying my best to implement the Service Layer/Repository/UOW patter using EF4 and POCO classes. Help me see if I am understanding this correctly. Lets say for the sake of keeping this simple,…
Sam
  • 15,336
  • 25
  • 85
  • 148
0
votes
1 answer

How to control error keys using ModelStateWrapper=

I’m using the a service layer with a ModelStateWrapper as shown here. What’s he proper way to control the error keys to use when validating in the service layer so they correspond to the input names in my views? e.g. I have the following ViewModel…
mmutilva
  • 18,688
  • 22
  • 59
  • 82
0
votes
1 answer

Stateless Service Layer in Spring

These days im working on a Web project and i just want to clarify couple of things regarding Spring bean scopes and best practices for Spring based developments. Here i am using a scenario using a sample code I have a Web Controller as…
keth
  • 793
  • 2
  • 11
  • 36
0
votes
1 answer

What should I return from my service layer? DotNetOpenAuth

I am wondering what should I return in this case. My Ui and service layer are in different projects. This is what happens -> User Comes to Site -> User chooses openId provider and hits login -> Post back to controller [HttpPost] public…
chobo2
  • 83,322
  • 195
  • 530
  • 832
0
votes
1 answer

Jersey Service and Persistence Layers

I'm am developing a simple Question and Answer service (Jersey JAX-RS). With this service, I've come up with the following resource so far (might increase). GET|POST -------------/questions GET|PUT|DELETE -- /questions/{id} GET|POST ------------…
Julez
  • 1,010
  • 22
  • 44
0
votes
2 answers

Several applications sharing the same codebase

I have a codebase, which will be used by several applications. What techniques would facilitate this requirement (service layer?)? Thanks
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
0
votes
0 answers

Azure Mobile App with service layer

In MVC web applications we tend to use architectures with multiple layers. I like to use a service layer which encapsulates the business logic and has the data access layer etc. below. The service layer, can be used by multiple frontends. Since…
Florian
  • 5,918
  • 3
  • 47
  • 86
0
votes
1 answer

node.js: injecting dependencies in app.js

I am developing an application using node.js and typescript. I patterned my server.ts file after the approach outlined in this article, http://brianflove.com/2016/11/08/typescript-2-express-node/, here is the sample code for the server.ts…
user1790300
  • 2,143
  • 10
  • 54
  • 123