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
2 answers

Spring : Controller and Service Layer coding standard example

I am checking out my project code and found below method in controller. On the net I found that controller is for receive request and provide response. Service Layer is for Business Logic and Dao layer is for data CRUD related operation. In below…
VJS
  • 2,891
  • 7
  • 38
  • 70
0
votes
0 answers

How to push a mysql result's fields up to become the property of a class

How can I push a mysql result result's fields up to become the property of a class? For instance, this is my result, object(ArticleModel)[4] public 'item' => object(stdClass)[7] public 'article_id' => string '4'…
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
1 answer

How to achieve Polymorphic behaviour with the Grails Service Layer

I have googled a lot on that topic, but I only found this Stackoverflow post. Assuming I have a simple domain model hierarchy as such: class Furniture{} class Table extends Furniture{} class Sideboard extends Furniture{} How can I implement a…
nst1nctz
  • 333
  • 3
  • 23
0
votes
1 answer

Service for controler/service for poco

I'm about to build my service layer and I've got some doubts. Should I create particular service(cs class + interface) related with controller or should I create the service related with poco class exclusively? Let me give you an example. I've got:…
WaltLift0
  • 43
  • 1
  • 5
0
votes
1 answer

PHP Service Layer and json encoding

I have a REST controller whice should return a list of companies in json format. The companies are fetched by a service. Where should i encode the result into json format? I tought of an encoder class, but where should i inject that?
Dominik Barann
  • 675
  • 2
  • 10
  • 25
0
votes
2 answers

Communicating input & processing errors from service layers

In my project, I have a service layer that manipulates repositories. The service layer is called by my controllers. In many cases, my controller layer is able to validate incoming information before it gets any further into the system. In some…
0
votes
1 answer

How to reuse a Service Layer in Zf2?

I have a Service Layer for my A module. Now I want to reuse the Service Layer by calling it from another module B. I understand that I have to inject my Service Layer in Controller of Module B. My question is how do I give the path of the Service…
user2740957
  • 171
  • 2
  • 15
0
votes
1 answer

getServiceLocator() in Service Layer in ZF2?

I created a service layer AbcService in order to allow modules to access common lines of code. But I need to use database to extract values in my AbcService. So, I need to call getAbcTable() which calls $service->getServiceLocator(). When I try…
user2740957
  • 171
  • 2
  • 15
0
votes
1 answer

.NET MVC Service layer constructor

I'm interested how to implement my constructor in services. I'm a bit new to .NET so don't get me wrong if question is too trivial. This are my current constructors but I would like to fully understand (since it looks like its working, I took code…
0
votes
1 answer

Using the service layer in custom authentication-provider ( Spring security 3.2)

I dont understand why i cant use the the service layer(file: Userservice ) in the authentication-provider (file: userDetailsService ). In result i had the error below, but when i used Repository layer(file: Repository) all are fine. i would…
Mikhail
  • 2,690
  • 4
  • 28
  • 43
0
votes
2 answers

Asp.net mvc How is the better way to build Business Logic Layer?

Hello I have a project that is communicating directly with the DAL layer. In DAL layer I'm using two patterns: Repository and Unit Of Work. In my controller I create the instance of Unit Of Work and use as follows: protected readonly IUnitOfWork…
0
votes
1 answer

Improving infrastructure of n-tier system

We are a small software company using .NET technologies. We have a home-brew framework which at first seemed to work well for some of our projects but now we see some problems. The presentation layer is ASP.NET MVC application. The service layer is…
JustAMartin
  • 13,165
  • 18
  • 99
  • 183
0
votes
1 answer

Is this method a good candidate for a service layer?

Should the following GetPhycialFileLocation() method in the Car class have it's own Service Layer? public class Car { public int id; public string model; public int year; public IList lstCarPics; } Then we have the respective…
InCode
  • 503
  • 3
  • 8
  • 25
0
votes
4 answers

How to mock httpcontext in service

How can the httpcontext in this service be mocked? When I attempt to unit test this service it complains about the httpcontext being null. What can be used in place of the httpcontext? I'm using webforms not mvc. I have seen multiple posts on…
InCode
  • 503
  • 3
  • 8
  • 25
0
votes
2 answers

baseurl in Service layer of zend framework 2

i am trying to implement service layer in my application. But i am facing problem while, when i am send mail from service layer to user. Problem: I am trying to send email confirmation from service layer, which include path of my website like
Aneeq Tariq
  • 436
  • 2
  • 4
  • 13