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

Best architecture design using service layer and interacting services?

I have several services that are currently highly decoupled. Now I have to extend them and they need to depend to access each other. Let's say I have 4 services: EmailService, HouseService, UserService, PriceService. Each user has an email address…
Marti Markov
  • 746
  • 6
  • 25
1
vote
1 answer

Why use DTOs insted of ORM generated entities

In C# commonly use DTO classes for data transfer. But also we can transfer data using Entity Framework generated class. But most of the time we uses DTOs to transfer data. Why DTOs needs to pass data across layers instead of using Entity Framework…
1
vote
1 answer

DDD: injecting IPrincipal into service and repository layers

I am currently working on a DDD-based application using Unity IOC container and need a way to pass my custom Principal object to the repository and service layers that would allow for unit testing. How should this be done? My current thoughts are…
1
vote
2 answers

Do you do input parameter validation in Resource class or Service Class?

I am creating a REST web service, such that the URL is as below: /users/{userId}/images/{imageId} I would have to do the following validations, before I do anything else: 1. Validate userId is in proper format. Ex: integer and not a string etc 2.…
David
  • 13
  • 3
1
vote
0 answers

Validation in service Layer with Spring MVC

I would like to know how to perform a clean code to organize validation in my service layer. So, I have this service: public interface PersonService { public Person getPerson(int idperson); public List getPeopleWithFather( int…
JohnPortella
  • 1,791
  • 5
  • 21
  • 30
1
vote
1 answer

getting Test input to test service layer CRUD operations

I have a service layer with methods to insert data into db, update data and delete data from db, which invoke DAO layer for the definitions of these methods. In the client package, I have a test class, where I get user input for the operations…
1
vote
2 answers

Interface between Controller and Service Layer

I am a newbie to .Net MVC and my question today is regarding the MVC pattern. In our application we have a Service Layer which talks with the DB. The Controller is Currently talking with the Service layer to get the values from the DB. Our new…
1
vote
0 answers

Multiple IOC Containers

We've created some domain services. On top of our services, we've added a Web Api layer on top to allow RESTFUL interactions with our services. We are using StructureMap for IOC. To get this to work I had to reference the domain and repository…
1
vote
1 answer

Python Service Layer

I am using Python 2.7.2 and SQLAlchemy 0.9.3. A Department has many groups. class Department(Base): id = Column(Integer, primary_key=True) groups = relationship("Group", backref="department") ... class Group(Base): id =…
Akash
  • 349
  • 3
  • 14
1
vote
2 answers

Shared services in Repository Pattern

I am wondering how to deal with a situation when inside one service lets say ICompanyService I need to call another method from IUserAccountService. ? So generally lets say that a Company shouldn't exist without an UserAccount. The IUserAccount…
Cristian E.
  • 3,116
  • 7
  • 31
  • 61
1
vote
1 answer

ASP.NET MVC and Service Layer Dependency Injection

I have some problems with constructors in controller and service that is called by controller. This is my service: // model state dictionary for validation private ModelStateDictionary _modelState; // initialize UnitOfWork private IUnitOfWork…
1
vote
0 answers

Appropriate layer for a DocumentPaginator

I created a generic Paginator that leverages some Attributes to paginate an IEnumerable of any given type. At first I placed it in my services project, but now I'm not sure anymore, since afaik every service has to expose an interface, and in this…
Sergio
  • 2,078
  • 3
  • 24
  • 41
1
vote
3 answers

Grails manual transactions with no domain classes

I'm not sure if I'm missing something here but is it possible to do manual transaction management in Grails (in groovy classes in src/groovy) without using the withTransaction method? I don't have any domain classes in my app as I'm calling into…
dre
  • 1,027
  • 1
  • 11
  • 31
1
vote
1 answer

What are some options for java messaging from service layer to front end

So in my Service layer I have some logic that does some stuff. Sometimes it has to check to see if something is possible before it does it OR it just has to get some OK from the front end ("Are you sure you want to do this?" kind of stuff). The…
markthegrea
  • 3,731
  • 7
  • 55
  • 78
1
vote
4 answers

Service layer in spring - autowire all services

I was thinking about some of my services. Some of them looks like this: @Service public class UserService { @Autowired UserDao dao; @Autowired OtherService1 serv1; @Autowired OtherService2 serv2; @Autowired OtherService3…
Urbanleg
  • 6,252
  • 16
  • 76
  • 139