i'm using DDD architecture in my project and I need to create a class to generate a GUID to use in another class.
This class that generate my GUID is a Infrastructure Service or a Infrastructure Helper?
How I know when a class is a Helper or a Service?
Service able to serve some clients, and often this is a SOA specific entity. Helper provides a set of methods which commonly are pure functions.
From my point of view if a class which provides the GUID generation functionality stores or uses this GUID for further needs - it is a Service class, otherwise I would say it is a Helper
because simply work by principle do and forget / generate and forget.
Often if you can make method a static method - this is a helper method, it does not depends on any class state and does not affect it as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With