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

MVC 5 Windows Authentication in AuthorizeAttribute and Service layer

I have a 3 tier MVC solution: MVC Web - Business Layer - Data Access Layer I have custom tables for users and groups in a database back-end, the user groups are mapped to a custom permission structure. The authentication needs to check for…
0
votes
1 answer

How does Service Layer and Data Access Object layer fit into Spring MVC architecture?

I've read that DAO layer and the service layer is a part of Model in MVC. How is it so?
user3508140
  • 285
  • 2
  • 18
0
votes
1 answer

PHP MVC: Share model between controller and view

I'm working on my PHP (H)MVC project in which I separated the views from the controllers - as in the answer How should a model be structured in MVC?. Their relationship is 1:1, so they have the same "actions". Therefore, in bootstrap.php, after I…
user7941334
0
votes
2 answers

Is it bad practice for the service layer to have methods that don't deal with the database?

I've got the following methods in my User Service Public Interface IUserService Sub AddUser(ByVal claimedidentifier As String, ByVal notes As String) Function GetAllUsers() As IList(Of User) Function GetUserByID(ByVal id As Integer) As…
Chase Florell
  • 46,378
  • 57
  • 186
  • 376
0
votes
2 answers

How to use Separate Repository and Service layer assemblies in ASP.NET Core apps

I can't seem to find a good way to create separate Service Layer and Repository Layer assemblies while using ASP.NET Core applications. I am trying to do it with EntityFrameworkCore and Azure Storage. I have found a few workarounds where they use…
0
votes
2 answers

Is caching enabled by default when we create a custom service layer in Liferay?

Does liferay support caching for custom service layer by default or are we supposed to cache service calls using WebCachePool?If yes,how can we achieve the same and is the same approach need to be followed for external service calls,not generated…
Shivam Aggarwal
  • 795
  • 1
  • 11
  • 30
0
votes
2 answers

Asp.net core separation of concern using service layer

I'm having a problem on what is the best approach to design my service layer and use them in my controller. Here is my concern. Currently I'm using this to delete categories [HttpPost] [ValidateAntiForgeryToken] public IActionResult…
0
votes
1 answer

Where should I do the mapping stuff? Repository or Service Layer?

Well, I have this DB Model "Book" public class Book { public int Id { get; set; } public string Title { get; set; } public string Author { get; set; } public bool IsSubmitted { get; set; } public bool IsCompleted { get; set; } …
0
votes
2 answers

ASP.NET complex validation in business / service layer

I am asking this because after long time searching I haven't found a good answer on this yet... Here is what I want: Example: I have a domain model "JobPosting" which a user should be able to change state to published, if it is still a draft. Before…
0
votes
2 answers

Entity Framework DbContext Lifetime in ASP.NET MVC Using Ninject?

I have the following unit of work pattern set up for an MVC 5 application using Entity Framework. The unit of work has all the repos defined as follows so that they are all using the same dbcontext and it has one save method to co-ordinate the…
0
votes
1 answer

Encapsulating of service layer from Password Encoder

In my service layer I have method wich updates email: @Override public void updateUserEmail(String email, String newEmail, String password) throws InvalidPasswordException, DuplicateEmailException { Client client =…
Yuriy
  • 1,370
  • 4
  • 14
  • 30
0
votes
1 answer

HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException when calling service layer method

I am facing a NullPointerException when calling userAuth(String UserId) method. The following are the files of my project along with the error snapshot. Error: Directory Structure LoginController.java package com.skit.app.controller; import…
0
votes
0 answers

Unit test service layer with spring

I'm trying to unit test this class in the service layer of my web application: @Service public class MyServiceImpl implements MyService{ @Autowired private MyDao myDao; @Autowired private MapperFacade mapper; @Log private…
0
votes
1 answer

How to capture a text from the cucumber result after executing a feature file and pass it to another feature file as a test data?

I have a feature file A.feature which generates a number in the response body. Now, I have to capture that text/number and then pass it as test data to another feature file.Do we need to write step definition or is there any other way?Please…
Rahul
  • 759
  • 3
  • 21
  • 43
0
votes
1 answer

Correctly architecting Jersey WS + Hibernate to concurrency

I've developed a web service using Jersey 2 and Hibernate 5. I'll explain the architecture of Hibernate. I use Dao pattern: only a unique DAO, despite the fact that I've a few classes. I haven't created any interface the Dao should implement. I…
joninx
  • 1,775
  • 6
  • 31
  • 59