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
11
votes
6 answers

How should be my Service method signature?

I'm using a Service Layer, and until now I used a ServiceObject (which implements ArrayAccess, Iterator, Countable) but I'm wondering if it's a good ideas. Would you do: ArticleService::createArticle($articleData, $userId); or…
JohnT
  • 967
  • 2
  • 16
  • 30
11
votes
2 answers

Separation of validator and service with external API calls

I'm currently building a web application and attempting to design it following good MVC and service-oriented architecture. I have, however, hit a bit of a wall in connecting the presentation layer (i.e. my controllers) and the back-end services…
Jason Larke
  • 5,289
  • 25
  • 28
11
votes
2 answers

Injecting a service into another service

I have an MVC project which has two services an OrganisationService and an AgreementService, my problem is that some of the organisations belong to a group/parent structure, when this is the case I need to get all agreements that belong to any of…
Newm
  • 1,313
  • 3
  • 16
  • 29
10
votes
4 answers

How can I pass service layer validation messages back to the caller?

I've done alot of research, including here on SO, and I can't seem to find clear direction. I currently have an ASP.NET MVC3 application, with a service layer that sits on top of a repository. In my service layer, I have functions such as: public…
Josh
  • 805
  • 10
  • 22
9
votes
4 answers

Service layer in java swing application

i'm thinking if i really need a service layer. I'm using spring + hibernate for a desktop swing application and at this moment i have gui/swing layer->service layer->dao layer. I use spring only for @Transactional support and for IOC-injection Best…
blow
  • 12,811
  • 24
  • 75
  • 112
9
votes
2 answers

The effects of adding a Service Layer to a Laravel application

I have been developing with Zend Framework for a number of years and am now learning Laravel. In my previous applications I usually have a Service Layer that is called by controllers. The Service Layer sits across the top of a Mapper and a Domain…
DatsunBing
  • 8,684
  • 17
  • 87
  • 172
9
votes
4 answers

Correct way of implementing a service layer in CodeIgniter applications

Below are two ways a service layer can be implemented in an CodeIgniter application. 1st method 1.send request to the controller 2.calling service layer methods from controller 3.return processed result data set(D1) from service layer to…
Susantha7
  • 898
  • 1
  • 20
  • 38
9
votes
1 answer

Responsibilities of Service and Repository layers

Just trying to get my head round the responsibilities of the service layer and repository layer when saving an object to my persistence store. My current under standing is this: In my controller I have created a "Note" object from the data submitted…
Gaz
  • 1,249
  • 3
  • 19
  • 37
9
votes
1 answer

Should Service Layer methods expect instances or id's?

This question arised from my work on a Grails application, but it applies to pretty much every web application developed in layers. Here's a simple example: class OrderService { // Option 1 def shipOrder(Order order) { order.status…
8
votes
2 answers

How to manage transactions in the service layer?

We’re developing a .Net application with the following architecture: presentation layer (using MVC pattern with ASP.Net MVC 2), service layer, data access layer (using repository pattern over Entity Framework). We’ve decided to put the transaction…
mmutilva
  • 18,688
  • 22
  • 59
  • 82
8
votes
4 answers

Does the Facade pattern violate SRP?

SRP principal say: a class or module should have one, and only one, reason to change I have some Facade class as my service layer classes. e.g SaleService, that it provide some methods e.g SaveOrder(), CancelOrder(), CreateOrder(), GetAllOrders(),…
8
votes
2 answers

Spring security securing the service layer, the web-service layer or both?

I have an API which I'm exposing via REST and I'm deliberating about where to place the authorities restrictions. I've read that there is a best practice about securing the service layer as it is the one doing the work and you don't know where it's…
Ittai
  • 5,625
  • 14
  • 60
  • 97
7
votes
2 answers

SoapUI Maven plugin- executing multiple projects

I am working on converting an Ant execution of the SoapUI TestRunner to use the maven plugin and I cannot get a good answer on how to execute multiple projects using this plugin. I found a forum post from 2010 on the Smartbear forum and there are…
Steve Miskiewicz
  • 1,114
  • 1
  • 10
  • 23
7
votes
4 answers

Implementing the Repository Pattern in ASP.NET MVC

I am still having a hard time wrapping my head around this. I want to separate my layers (dlls) like so: 1) MyProject.Web.dll - MVC Web App (Controllers, Models (Edit/View), Views) 2) MyProject.Services.dll - Service Layer (Business Logic) 3)…
7
votes
1 answer

How to pass complex ViewModel to Service Layer in ASP.NET MVC?

Say I have RegisterModel for user registration and some UserService that implementing IUserService public interface IUserService { User CreateUser(User newUser); } [HttpPost] public ActionResult Register(RegisterModel model) { if…
Eldar
  • 862
  • 9
  • 22
1 2
3
26 27