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
1 answer

MVVM, repository pattern and service layer

I will develop an application with Xamarin.Forms. I will use mvvm pattern, but I heart from someone that he used repository pattern and services layer with mvvm. What is the common way of working?
0
votes
2 answers

How to solve Cyclic Dependency

public class NotificationService: INotificationService{ private ILogService _logService; public NotificationService(ILogService logService){ _logService = logService; } } public class LogService: ILogService{ private…
h3n
  • 5,142
  • 9
  • 46
  • 76
0
votes
2 answers

Using ViewBag or calling service method on View

I wonder what should I use when to fill SelectList on View. I know two ways to do that. First; Set ViewBag on controller's get method. ViewBag.DepartmentList = new SelectList(_departmentService.GetAll(), "Id", "Name", selectedValue:…
Engineert
  • 192
  • 1
  • 1
  • 16
0
votes
4 answers

Performance impact of having a data access layer/service layer?

I need to design a system which has these basic components: A Webserver which will be getting ~100 requests/sec. The webserver only needs to dump data into raw data repository. Raw data repository which has a single table which gets 100 rows/s from…
Hari Menon
  • 33,649
  • 14
  • 85
  • 108
0
votes
1 answer

Decorator pattern to simulate multil-layer service layer

The code examples are in PHP but the question is language agnostic. Situation I'm trying to figure out the best way to separate a service layer into multiple well defined layers. In the example below I'm uploading a base64 encoded user avatar and…
ibanore
  • 1,500
  • 1
  • 12
  • 25
0
votes
1 answer

How to prevent DTO`s when using asp.net MVC with domain services

I have Repositories and services. The services either orchestrate multiple repository calls or doing some in memory data logic merged with the repository calls so that I want to return DTO's. These DTOs are then perfect trimmed for the UI. But... I…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
0
votes
2 answers

How much service layer logic in controller?

I am still new to ASP.NET MVC world and still try to learn best practices and best architecture patterns. Here comes one the things where i can't decide on my own and need community support: I am not sure where I should put all of my business logic…
0
votes
1 answer

Question about ASP.NET MVC 2 Custom ViewModels

In my project I have my Linq To SQL dbml file, A Repository Layer for each DB Table and a Service Layer for each Repository. In my service I have some MetaData for Validation as well as I extend each (table) Class to add some custom information to…
Chase Florell
  • 46,378
  • 57
  • 186
  • 376
0
votes
1 answer

Convert Linq To Sql with JOIN to IQueryable select

I have a function called GetUserByOpenId I don't want to be using this function at all Public Function GetUserByOpenID(ByVal claimedidentifier As String) As User Implements IUserRepository.GetUserByOpenID Dim user = (From u In dc.Users …
Chase Florell
  • 46,378
  • 57
  • 186
  • 376
0
votes
1 answer

ASP.NET how to implement IServiceLayer

I'm trying to follow the tutorial found here to implement a service layer in my MVC application. What I can't figure out is how to wire it all up. here's what I have so far. IUserRepository.vb Namespace Data Public Interface IUserRepository …
Chase Florell
  • 46,378
  • 57
  • 186
  • 376
0
votes
1 answer

Can I use method of service layer class in non mvc class?

I want to know whether I can use object of service layer marked with @Service annotation and call one of its method in non mvc-spring class ? Say there is a method getUsers() in service layer which calls getUsers() of Dao layer. In order to use it…
u12345
  • 389
  • 2
  • 8
  • 17
0
votes
0 answers

confused about what my service method should return

I have 2 domain classes: User and Role. 1 User can have 1 or more Roles. public class User implements Serializable { private String username; private String password; private boolean lockFlag; private List rolesList; // getters…
srh
  • 1,661
  • 4
  • 30
  • 57
0
votes
0 answers

Service Layer don't auto wire DAO using EntityManager

I have the following code in my DAO: @Repository public class PedidoDAO { private static final Logger logger = Logger.getLogger(PedidoDAO.class); @PersistenceContext private EntityManager manager; public List getPedidos()…
user3333944
0
votes
1 answer

Spring MVC - How to create a proper Service layer?

I'm using SpringBoot and I am trying to create a service layer for my web application but i cant make it work. My classes look like this ServiceFactory @Service public class ServiceFactory { @Autowired public static EncuestaService…
QoP
  • 27,388
  • 16
  • 74
  • 74
0
votes
1 answer

Laravel Eloquent Relationships with Repository/Service Design Pattern

I am currently working on a web app that has been set up using the Repository/Service Layer Design Pattern, i.e. I have service layer that does any necessary business logic before running any methods within the repository. I have facades for each…