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

putting complex, multi-domain related logic: in Service layer or in model itself?

I'd like to apply Domain Driven Design principles in my project but couldn't determine what I should do with the business logic of dependent models. For example, suppose this scenario: I have Person and Car domain models. Each Person is suitable…
Kamyar
  • 18,639
  • 9
  • 97
  • 171
-1
votes
1 answer

Where should I log info and errors in a backend with services and controllers?

When building a backend, I usually log messages inside the controllers like this: router.get('/books', async () => { const books = await booksService.getAll() logger.info('All books returned successfully') return books }) But what if getAll…
Federico Peralta
  • 337
  • 4
  • 11
-1
votes
1 answer

Dependency injection in Laravel service layer class

In my Laravel 6.9.0 app, I have some code which I need to run from many places, so I'm working on creating this as a service layer. I've created the file /app/Actions/Music/GetRecentArtists.php and added it to my composer autoload…
Adam Hopkinson
  • 28,281
  • 7
  • 65
  • 99
-1
votes
1 answer

How do I inject dependency in service layer?

I am new to Zend Framework 2 and I am new to the concept of dependency injection, service layer and factory. I am currently trying to create a service layer that required Service Locator. Once that works then I need to pass this service to a…
-2
votes
3 answers

Show model errors in client side without postback

I have created a form using asp.net mvc with service layer to validate business logic without model validation using Data Annotations. This is my code in the service class for validation public class TutorService : ITutorService { …
1 2 3
26
27