I always see some classes that is named "ClassNameService", well what is the difference as logic? What is the goal of these service classes?
Related Questions in LANGUAGE-AGNOSTIC
- Name for defining a function with fewer arguments that calls the original function
- Given a radius R, find the minimal number of circles to maximize the area where the circles' center belong to a set of points P
- How to get the previous index of an array (ring buffer way) in a clean way?
- Quicksort partition algorithm -- why is the swap with the pivot value outside of the loop?
- How to compute overlap time of two arrays of (price, time) elements
- Proper way to lru cache a read call for data that may or may not have been written at the time of the call
- Are concurrent non-atomic writes to never-read memory safe?
- How to apply the same operations to rows in a matrix to columns without code duplicaton?
- Want to match a string exactly, despite variants, and remove only that string
- goto statement in language standard
- How many permutations of an array when created into a number are divisible by 4 or 8?
- How many distinct digit permutations exist for a specific N-digit number?
- Why is there an error in this Dynamic Scoping example?
- What diff algorithm relies on finding the longest common prefix and suffix and cursing on the middle substring?
- How to determine if there are n consecutive pieces of the same color after every move?
Related Questions in DOMAIN-SERVICE-CLASS
- Are observers really necessary if my service classes are responsible for all CRUD operations?
- DDD - Can an aggregate method with an aggregate parameter block an action based on that aggregate parameter's state?
- Unit Testing Service Layer in Spring Boot
- How do I access the data from my domain service in my view model ? Silverlight 5 application
- Models, Repositories, Service classes & Jobs (commands)
- What is the service class in programming?
- Which layer should be used for user authentication
- SendEmail method in Member service?
- WCF Ria Services Wizard not working with CodeFirst
- How to use the dbGeography spacial data type of EFv5 with a WCF RIA domain service class
- overriding RIA DomianService code generation
- Custom RIA Domain Service not based on an ADO.NET entity
- How to formulate join queries in domain service class?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Generally speaking, there could be a hierarchy of domain objects, which are controlled by the services. If these domain objects are only data placeholders, with no behavior, then this is not true to object-oriented programming.
What we have here is what Martin Fowler would call the Anemic Domain Model.
More commonly, within OOP, a group of domain objects have behavior whose interactions form business logic. This logic, in turn, is encapsulated by the Service.
Such services are stateful, with their state being comprised of these domain objects. Services may also be stateless and offer self-sufficient functionality.
Imagine, if you will, a very simple calculator API.
A HTTP request is sent to your application, which then uses the API to perform data extraction and some complex calculation. The application endpoint then returns a HTTP response containing the computed data as a SOAP/REST/etc. message.
Once the response is received, this should then be returned to the client that sent the original request.
You don't want to force your client to manually invoke the computation and transformation of the input. Instead, you want to simply offer them a service API which encapsulates this logic and returns to them the expected result.
For Spring applications, you have the Spring annotation
@Service.