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
1
vote
1 answer

spring inject dependent objects - A & B two objects injected, B needs A in constructor

I am unsure the right way to do this. here is a simple representation of what I am trying to do, I will explain in a second step why I am doing this. Two objects A and B need to be injected into class myClass. A can be injected with no parameters,…
1
vote
1 answer

Is it okay for my Domain Objects to know about Repositories and ServiceLayer?

I'm designing a C# layered application and I'd like to know if it is okay for my Domain Objects to know about the Repositories and the ServiceLayer. If not - how do I solve complex functions like Article.CalculatePrice() or Offer.CalculatePrice,…
1
vote
0 answers

Type-safe IDs in service layer for error prevention

I'm currently writing on the business logic of an Java-application. I've splitted it into domain layer and service layer. The service layer provides interfaces which allow access on the data via data transfer objects. The idea i've got is to make…
Jimmy T.
  • 4,033
  • 2
  • 22
  • 38
1
vote
1 answer

Should I Create Domain Object Defaults in my Service Layer?

I am building a MVC application with Zend Framework. The Model includes separate Domain and Mapper layers, and a Service layer sits on top. For some of my Domain objects, when I create a new instance I need to create other Domain objects which are…
DatsunBing
  • 8,684
  • 17
  • 87
  • 172
1
vote
1 answer

Implement Service Layer into Yii Framework

I have started using the Yii framework and am really enjoying the way they do things. Though 1 thing I don't entirely agree with is the all the logic to do with interacting with the database is told to be put into the models. "Skinny controllers,…
Adam
  • 675
  • 5
  • 25
1
vote
1 answer

Designing DTO's and DO service layer

I'm designing a new large scale application which needs to be as flexible as possible. I chose designing mainly with DDD.. My question is about transferring DTO object's back to DO objects in my service layer. i.e: This is my domain object mapped…
Pavel Tarno
  • 1,324
  • 1
  • 12
  • 29
1
vote
1 answer

How organize layers in a project using Entity Framework?

I have a dilemma about organizing my projects. I'm building an application for sending newsletters. I divided it into three projects in my solution: Newsletter.UI (WPF), Newsletter.DAL and Newsletter.Services. In Newsletter.DAL there are classes…
pmichna
  • 4,800
  • 13
  • 53
  • 90
1
vote
4 answers

Access Repository through Service or directly?

is itIa good coding standard to allow ASP.NET MVC controller actions to access a repository directly (even though a service layer is present for the heavy lifting, e.g. LoginService.Authorize() ) to retrieve, add, or update data? Or should…
Alex
  • 75,813
  • 86
  • 255
  • 348
1
vote
2 answers

Linq2Sql - How do you lazy load nested lists?

How do you lazy load nested lists without actually executing the query? Using a very basic example, say I have: class CityBlock { IList BuildingsOnBlock; Person BlockOwner; } class Building { IList
MunkiPhD
  • 3,636
  • 1
  • 29
  • 51
1
vote
1 answer

ASP.Net MVC Architecture - Missing a layer?

I am using the Entity Framework/Repository-UnitOfWork/Service layer method on this ASP.NET MVC Application and it works great, but it seems a layer might be missing in order to keep the controllers thin. Lets take for example a user authentication…
Sam
  • 15,336
  • 25
  • 85
  • 148
1
vote
1 answer

Application Architecture Advice

I have been studying various patterns for layering an MVC application and need a little advice. What I currently have is the following: 1) POCO Domain Model, no business logic at all, so basically an anemic Domain Model. 2) EntityFramework with a…
Sam
  • 15,336
  • 25
  • 85
  • 148
1
vote
1 answer

If I use a facade class with generic methods to access the JPA API, how should I provide additional processing for specific types?

Let's say I'm making a fairly simple web application using JAVA EE specs (I've heard this is possible). In this app, I only have about 10 domain/data objects, and these are represented by JPA Entities. Architecturally, I would consider the JPA API…
Shaun
  • 2,490
  • 6
  • 30
  • 39
1
vote
1 answer

Understanding Domain Services vs. Application Services vs. Behavior (Methods) in Domain Entities

We’ve been working on developing an architecture for a layered application. We are planning to have an ASP.NET MVC presentation layer that serves both mobile browsers and ‘normal’ browsers. That is, we need the same ASP.NET MVC presentation layer…
lmttag
  • 2,499
  • 4
  • 26
  • 30
1
vote
1 answer

what is best way service layer can provide to tell Controller part if anything happens bad(Exception)

I am using spring3.0.2 for my project "Online Exam" Putting business logic in service layer makes controller easy to feel. what is best way service layer can provide to tell Controller part if anything happens bad(Exception) Eager to hear soon!!
rohit
  • 602
  • 4
  • 11
  • 24
1
vote
2 answers

asp.net mvc3, which layer should I put my code in?

I am building an applicaiton using asp.net mvc3. I added two layers to this project, repository and service layer. some of my code, I am not sure which layer I should put them in. on my register page, to create an account, I only ask user to…
qinking126
  • 11,385
  • 25
  • 74
  • 124