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

Common dependencies in several Services

My goal is to have the same dependencies in different Services. I need it because in some cases I use the same entity for different Services. Example: ... $user = $this->userRepository->find(123); $this->userService->doSomeWithUserRepository(); #…
1
vote
0 answers

Would you use Assertion or Dynamic Acl?

I'm implementing an AuthorizationService, basically it extends Zend_Acl and override authenticate() method to work with my own adapter. Let's say I've User, Article, ArticleComment, ArticleVote, CommentVote. My rules are simple: An Member can edit…
JohnT
  • 967
  • 2
  • 16
  • 30
1
vote
1 answer

Is it wrong to use Service Locator to provide the container instance to a Service?

I'm using a Service layer, then, I've alot of Service like: UserService ArticleService CommentService AuthorizationService Sometimes I need to use a Service from another Service. Currently, I'm using sfServiceContainer for dependency injection,…
1
vote
1 answer

WCF / Service Layer / Repository Layer: Returning DTO from Service layer? And creating ViewModel in Controller from the DTO returned

I have a WCF Service, behind the WCF service is a Service layer (http://martinfowler.com/eaaCatalog/serviceLayer.html) and repository layer. So a client calls the WCF Service layer and the WCF Service layer (acting as a service layer) calls the…
Martin
  • 23,844
  • 55
  • 201
  • 327
1
vote
1 answer

asp.net core with clean architecture and AutoMapper - Pass DTO through service layer to controller

I build an asp.net core web api with clean architecture, my layers are: Web API Service layer Domain layer Data layer In my Web API I'm loading data from an external Exchange Webservices. i would like to provide in my own Web API for my…
1
vote
0 answers

UnitOfWork exposed in service layer. Am i approaching this correctly?

I am currently working on a commerce extension thing, where i am not able to use dependency injection, and i have to keep packages to a minimum. I am using PetaPoco as a micro orm. I created a unit of work, to handle disposal of dbcontext, and a…
1
vote
1 answer

How to use Mongoose skip and limit function in service layer?

How do I get a document list from DAO and perform skip, limit operations in the service layer? This is my DAO function. function findAllPosts(first,second) { return Post.find({}); } Here is my service layer. function findAllPosts(first, second)…
joler-botol
  • 442
  • 1
  • 7
  • 22
1
vote
1 answer

Should a DTO Interface be defined in Domain or Service Layer?

I want the adpaters to pass a common interface to the cart service. I've read that interfaces should be in the Domain layer and DTOs to be defined in the Services layer, which seems to conflict with me. You don't want the Domain layer to have a…
crichavin
  • 4,672
  • 10
  • 50
  • 95
1
vote
1 answer

What type of implementation will be more suitable in service layer?

I am developing a new microservice application that will be part of big architecture with lots of other microservices. This application needs to get content from other applications and I want to encapsulate HTTP calls into the service layer. But I…
Ahmet Can Güven
  • 5,392
  • 4
  • 38
  • 59
1
vote
1 answer

Sap B1 Service Layer Write (POST, PATCH etc.) Error. Asp.Net Httpwebrequest

I'm facing with an exception when I send data to Sap B1 Service Layer via Asp.Net HttpWebRequest. We were using https://xx.xx.x.xxx:50000/b1s/v1/ address for service layer operations but then we switched to http://xx.xx.x.xxx:50001/b1s/v1/ address…
Cansın Memiş
  • 55
  • 2
  • 10
1
vote
0 answers

Add layer to abstract multiple proxies & services

I think elements of this question have been answered elsewhere, but I couldn't find an answer to my specific circumstance. I work with an enterprise application. This application interfaces with various 3rd party APIs & services via what is…
Emma
  • 19
  • 7
1
vote
2 answers

Should repositories supply all the data to the services?

What I mean by that is, say I have a method in my repository: Public Function GetCustomerByState(ByVal State As String) As IQueryable(Of Customer) Should the service be able to get additional data in the form of say this extension to say get the…
Sam
  • 15,336
  • 25
  • 85
  • 148
1
vote
2 answers

Business Layer errors and Service Layer handling - Best way?

We're building a large web app that has numerous layers. In order to communicate to the business layer we're using a service layer that the web layer calls when data is needed. Unfortunately, it seems that if exceptions are thrown in the business…
DavidAndroidDev
  • 2,371
  • 3
  • 25
  • 41
1
vote
1 answer

Project Naming Convention Feedback Please

I am creating a ASP.NET MVC 3 application using Entity Framework 4. I am using the Repository/Service Pattern and was looking for feedback. I currently have the following: MVC Application (GTG.dll) GTG GTG.Controllers GTG.ViewModels Business…
Sam
  • 15,336
  • 25
  • 85
  • 148
1
vote
0 answers

I have to use a lot of mocks to test my service layer, is that okay?

So I'm pretty new to testing and while it makes a lot of sense to me, some things just don't feel right. For example: Is it acceptable to use quite a lot of mocks to test a method? Specifically, I'm testing my Service Layer which has a method to…
lechuckor
  • 11
  • 2