Questions tagged [service]

78 questions
72
votes
7 answers

How essential is it to make a service layer?

I started building an app in 3 layers (DAL, BL, UI) [it mainly handles CRM, some sales reports and inventory]. A colleague told me that I must move to service layer pattern, that developers came to service pattern from their experience and it is the…
BornToCode
  • 1,273
  • 2
  • 13
  • 16
69
votes
6 answers

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 database instance or literally having another…
xenon
  • 887
  • 1
  • 6
  • 9
25
votes
3 answers

MVC: What is the difference between a model and a service?

Why in some frameworks the logic layer is called "Model" whereas in some it is called "Service". Are they different from each other or just different by naming conventions? UPDATE 1 The reason I'm asking is because in Zend Framework, a classical…
Guilhem Soulas
  • 351
  • 1
  • 3
  • 5
19
votes
2 answers

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 against a domain object. In September 2013…
Andy
  • 10,238
  • 4
  • 25
  • 50
15
votes
1 answer

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 from different Services and set them as part of the…
Diyarbakir
  • 539
  • 2
  • 5
  • 12
12
votes
3 answers

How to manage 2 DAO methods in a single transaction?

In an interview someone asked me : How do we manage 2 transactional/dao methods in a single transaction. Desired capabilities: If anyone of them fails we need to rollback both methods. Both of the methods can be called separately attached with a…
Satish Pandey
  • 1,340
  • 3
  • 10
  • 20
8
votes
2 answers

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-man-show, so my opportunities to learn new…
7
votes
3 answers

Multi-threading in C# .NET Windows Service

I am writing a Windows Service (using C# .NET 3.5 VS2008) and my requirement is: When the Windows Service start - it performs record check operation (in Database) @ every 30 second interval (I have used a timer for this) If the appropriate record…
Ankit Shah
  • 71
  • 1
  • 1
  • 2
7
votes
2 answers

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 on the good approach for handling database access.…
7
votes
2 answers

local communications between two apps

To make a platform-independent program in C++ I want to separate the GUI (separate for each OS, using native libraries/APIs) and the actual program. Obviously those two need to communicate with each other. Doing that by saving and reading XML files…
6
votes
1 answer

Service repository and discovery without WSDL

I'm in the very early stages of moving a development team away from large monolithic app development to an SOA approach. One of the things that caught my eye in this article about SOA: Stevey's Google Platforms Rant "if you have hundreds of…
markp3rry
  • 221
  • 1
  • 6
5
votes
1 answer

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, assignCargoToRoute, etc). Why is it in Application Layer…
Teimuraz
  • 422
  • 1
  • 6
  • 9
5
votes
1 answer

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 Unit of Work(if any) in a Service Layer. From my…
5
votes
2 answers

Should controller layer create model objects or they should be created by service layer?

I have a small application with classic layers Controller-Service-Dao. Controller actually is REST resource, which deals with JSON data. And the questions are: 1. where is the best place to create business objects from JSON primitives? Controller…
sphinks
  • 159
  • 1
  • 5
5
votes
3 answers

Stateless service classes and method decomposition

I like implementing service classes as stateless. However, I also like to decompose my logic into more, simple methods or functions. In some scenarios it seems like the two are somewhat against each other. Consider the following two examples. I have…
Zoltán Tamási
  • 153
  • 1
  • 5
1
2 3 4 5 6