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
Helperbecause 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.