Questions tagged [service]
The service tag has no usage guidance.
79
questions
1
vote
2
answers
120
views
Specific get cases - Repository vs Service
I have a custom repository for each entity/module (I'm working with NestJS). I know that this is a lot of repeated code and I may refactor it in order to use a generic repository later, but currently ...
0
votes
1
answer
356
views
Is this a good example of what a service layer is in MVC?
I am wondering what a service layer is in MVC. I like to understand concepts through a game of monopoly as it's relatable to a lot of people and fairly easy to explain whilst allowing for some good ...
0
votes
2
answers
138
views
Decisions according to environment
I am trying to convince others that the following first code snippet is bad practice and the second snippet is best practice.
Bad practice:
// There is only one implementation of Adapter
public ...
2
votes
2
answers
2k
views
Should a single method in a service class perform multiple operations for its controller?
Let's say I have a controller called MessageReceiverController which is a controller of an API that other services can call and include messages in the requests.
For each of the messages the ...
2
votes
1
answer
318
views
How to boost reusability and extendability in a MVVM .Net application?
I'm a software engineer that primarily writes C code but now and then makes .Net applications for fun. This is a question about the fun part. Over a duration of about 15 years, I have used and ...
2
votes
1
answer
125
views
How to model an action that involves more than one model?
I'd like to start by saying that I'm new to DDD and I'm creating a hobby system to practice some concepts, so this question might be trivial, but not so much for me.
I have the following scenario:
I ...
-2
votes
1
answer
4k
views
What is meant by service? [closed]
We know there are services in windows but I am reading a book by Ed Snider and he uses the term “service” whenever his program requires a certain feature/functionality.
Like he creates a navigation ...
0
votes
1
answer
122
views
Gracefully handling failures in sequence of requests
I am designing architecture for service like pastebin.com. I plan to store user data on S3 storage and metadata with my own server. So whenever a user requests for some paste creation there are two ...
1
vote
1
answer
548
views
Can I put domain services inside domain entities?
Say I have a domain entity User:
class User {
constructor (username, email, password) {
this.username = username
this.email = email
this.password = password
}
}
Now, all users need a ...
0
votes
0
answers
37
views
Migrating an application using a custom API logging system
I'm turning a VB6 application into a VB.NET (using a migration tool). This software relies on a custom DLL which handles logging. This DLL logs to flat files and optionnaly in a GUI component.
Also ...
8
votes
2
answers
1k
views
Separation of concerns and other best practices across Controllers, Services, Providers and Stores in ASP.NET when building a REST web api
I am traditionally a desktop app developer, but circumstance has thrust me into the role of doing web client and corresponding REST api logic for a project I am involved in. Unfortunately, I'm a one-...
-1
votes
1
answer
128
views
Need some criticism for my backend app Architecture
I have been learning Backend development for quite a while now and I decided to build a bigger project using Express.js and the MVC architecture, the project is basically a Restful API with Vue.js in ...
2
votes
1
answer
57
views
Microservices for app with custom made API without imposing traffic load
Let's say you have an app like Facebook, where each Post can be tagged with a Place. Now, the whole social app backend api (basically the whole client api) is built using nodejs + postgres. But the ...
0
votes
0
answers
161
views
Separating Model classes into Model Project with dependency on Service layer
I'm working with a C# API Wrapper project that is entirely flat, meaning 1 project and namespace for all the files. I'm attempting to put the Models into a separate Models project, but I've hit a ...
0
votes
1
answer
490
views
Adding authentication and filtering in the service layer
I am currently developing a simple web-based application that consists of various layers:
Model Layer
Performs simple CRUD operations and provides access to the databes. Implements functions such as ...
4
votes
5
answers
2k
views
Do I use Repository or Service Object to Perform Logging?
I'm working in Java Spring, and I have typical service and repository layers. The repository grabs a JSON; passes it along to the service; service maps the repository response to a DTO.
I also need ...
0
votes
0
answers
153
views
What layer/object should I add a Helper method to get all Product objects from?
I have a Helper class and a Service class currently and I read this other question about the difference between a service class and a helper class and got confused. A method to get all products in my ...
0
votes
1
answer
540
views
Angular 2+ Providers/Service on Parent or Child component?
I have recently started diving deeper into Angular 7 (with Ionic 3) and I have written a lot of code so far, and I have child & parent component relationships - but never like this before. I am ...
1
vote
3
answers
612
views
Tracking state on entity and unit-of-work pattern
In my web app I have a long running operation that is processing some entity in the background. The state of this process should be visible to the clients. During the processing the UI should show ...
0
votes
1
answer
70
views
Delete dependent entities
I have a temporary report table which has a foreign key (source_id), e.g. report table:
| id | val1 | val2 | source_id |
| -- | ---- | ---- | --------- |
| 1 | 102 | 0.5 | 1 |
| 2 | 99 |...
2
votes
1
answer
3k
views
DDD - Factory or Service?
I'm new to DDD, and I'm confused at the very start of my DDD project. To setup a context, I'm building the user management part of my app, so I'm building my Account entity, which contains an Id, a ...
0
votes
0
answers
773
views
Clarification on the Onion architecture's Domain Service and Application Service
I am studying Onion Architeture but i got some doubts:
All the samples (github) I found over internet are too simple, or are implemented under DDD (which I have not studied at the moment) so I can ...
2
votes
3
answers
147
views
Should I be worried about having too many services?
I'm making an online game and it has a server handling smaller game server. We call it "MasterServer". This MasterServer listens to commands from both TCP and HTTP and answers to them using its own ...
68
votes
6
answers
33k
views
In microservice, is it single database or single database instance for each service?
I understand that a each service in a microservice architecture should have its own database. However, by having its own database, does it actually mean simply having another database within the same ...
4
votes
3
answers
5k
views
Calling service and repository layer from controller
A question came to the team and I'm asking you guys. Our application uses MVC with service layer. But sometimes our service layer just call the repository, without doing nothing
Our questions is: in ...
2
votes
2
answers
382
views
How to make a service running on a random port discoverable?
I want to create a service that would be running locally (not accessible from the internet) on a given port, then a browser extension will need to access this service.
My problem is that I cannot ...
4
votes
1
answer
2k
views
Domain Model vs Service in a MVC context
At the end of this article from Martin Fowler there is this sentence:
In general, the more behavior you find in the services, the more likely you are to be robbing yourself of the benefits of a ...
3
votes
0
answers
61
views
Layer below Service and NetworkingManager to handle received data
I'm in the early stages of building a cryptocurrency tracking app for iOS and looking for a scalable design. My question specifically relates to the element of the app which retrieves data from an API ...
4
votes
3
answers
354
views
Does Presentation Logic constrain design of Business layer?
We have an email plugin which encrypts a mail's attachments when the user sends an email and gives the mail's recipients permissions to decrypt the attachments. The recipient permissions are stored on ...
0
votes
2
answers
484
views
How to design a business datetime service class that performs two types of calculations based on an argument passed in
Context
I am making a service class that essentially functions as a business datetime calculator. That is, it can perform various calculations such as what date is X business days from a given date, ...
0
votes
2
answers
1k
views
An aggregate without an aggregate root?
This is not a problem I am having in my problem domain. It is just a thought exercise.
Say I have a simple calculator like this:
public class Calculator
{
public IEnumerable<KeyValuePair<...
1
vote
1
answer
1k
views
Windows Service with authentication, some UI required
I have to build a Windows Service which requires OAuth2 authentication. The service is intended (like all services should be) to run unattended (no user need to be logged in in Windows). The problem ...
2
votes
2
answers
324
views
Is an imposed workflow of services call an antipattern?
We have an application using a bunch of services. As soon as the application is launched it should call a webservice method, "RegisterMachineSession". In this method we accomplish some basic work that ...
1
vote
1
answer
3k
views
If Service Layer is doing nothing, just calling methods in DAO . Can my Service Interface just extend DAO Interfaces?
Why do we need to write same methods in Service Interface, when we just want a replica of DAO Interface.
interface DAOI
{
method1();
method2();
}
interface ServiceI extends DAOI
{
}
instead of ...
5
votes
1
answer
10k
views
DDD: How to distinguish between application and domain services?
I'm exploring Cargo DDD sample.
There is BookingService which belongs to application layer.
But looking at the code, it seems that all methods correspondent to Domain Logic (bookNewCargo, ...
0
votes
1
answer
260
views
Windows Services - one Service to rule them all or multiple smaller services?
In our software, we have a windows service that performs all our background processing from sending scheduled SMS to performing backups, (maybe 10 different functions).
I am questioning as to what ...
1
vote
2
answers
5k
views
Distinguishing the differences between view model and service layer
First project trying to use MVVM and Xamarin Forms, so please be gentle; however, I am at a lost on how to differentiate between the logic that belongs in the view model and model/service layer.
I am ...
1
vote
1
answer
212
views
Inversion of control in controller by a mediator
A user has to perform a somewhat complex task on my website (submitting a rating). For the sake of example, let's consider it's a rating for a movie, done through a controller.
There are several ...
5
votes
1
answer
6k
views
Is Unit of Work valid under a service pattern?
I've been studying design patterns. I've learned about Repositories, Unit Of Work, Dependency Injection, MVC. I'm now learning about Service Layer pattern.
I'm trying to grasp the utility purpose of ...
7
votes
2
answers
1k
views
What is a good reason for separating intelligence and dao layers in a microservice?
I am having a long-term debate with my architect about architecture choices. The entreprise where I work in is migrating from a monolithic architecture to a microservices one.
The debate is located ...
2
votes
2
answers
13k
views
Inter-Process Communication in .NET on the same computer
I want to split a C++/CLI application on two parts :
1. Communication Part, with I/O + logging on text file :
3 COM Ports, 2 sockets and 1 log file
2. UI Part, to handle the data received from COM ...
0
votes
1
answer
829
views
Android Activitiy and Service Sync
I've looked for the solution of my problem but I've failed in finding a suitable answer.
I've been trying to develop an Android application with heavy asyncronous networking capabilities. The problem ...
0
votes
2
answers
245
views
Where do we need to include non business logic validations in Service Layer
Currently um working in an application and it has the following hierarchy
WEB API2 Controllers (hilds the end points)
Business Logic Layer (Dedicated for business logic handling )
Data Access Layer ...
3
votes
1
answer
2k
views
Web API to Windows Service communication via ZeroMQ
I have an ASP.NET Web API 2 web service. This is the interface customers will use to submit data.
I have a Windows Service running on an internal server. I will be sending the customer's POST data to ...
3
votes
1
answer
3k
views
Laravel 5.2 - Better to create a Service Provider or Helper class or otherwise?
So I have created an API endpoint (obviously not restful) that generates xml and returns the file path of the files. Its obviously more complicated but that is the gist.
My issues is this. Inside my ...
20
votes
2
answers
10k
views
Is there an elegant way to check unique constraints on domain object attributes without moving business logic into service layer?
I have been adapting domain-driven design for about 8 years now and even after all these years, there is still one thing, that has been bugging me. That is checking for a unique record in data storage ...
15
votes
1
answer
40k
views
Controller calling multiple services
I have a few layers in my WebApplication: Presentation, Service, DAO, Domain.
Services call DAO objects which reads data from a Database/File whatever.
I have a Controller that needs to fetch data ...
0
votes
1
answer
708
views
Is it a good practice to use a Service without Delegate?
I have a simple REST application with a single controller. The application needs to fetch data from a Database, convert it to JSON and return this to the caller.
I need to decide what layers I should ...
3
votes
1
answer
146
views
where to put methods that manipulate objects
I have a controller method as follow:
public class RoomsController {
@RequestMapping(method = RequestMethod.GET, path="/v1/rooms/{name}")
public ResponseEntity<?> getRoomInformation(@...
4
votes
1
answer
366
views
What's the purpose of having services in containers?
I've been very interested in Service Oriented Architecture, and Microservices. Many resources talk about having services in containers.
To me, one of the big benefits of seperating an application ...