My question is in regards to the following:
If I have a class that manages users, lets call it UserManager
. Should it be responsible for updating users in the database (something like RegisterUser
, UpdateUser
methods which uses a repository interface) in scenarios where a new user registers or updates profile?
I think this task can be delegated to another class. Something like UserSubscription
class that handles calls(events) that are related to the UserRepository
. I imagine this UserSubscription
class of having methods (lets call them UpdateUser
, SubscribeUser
) that recieves ValueObject
from UserManager
class and uses them to update or register users. I think that this UserSubscription
and UserManager
classes could be in the same Aggregate in the Application Layer.