Reputation: 327
Let's say you're constructing a domain model and you have the following requirements:
From an OOP perspective, you would create a base class that has everything common to each of the "actors" above. Then, I would create subclasses to represent each of the concrete types. My question is this, in DDD world, how should I arrange my aggregates?
Thanks!
Upvotes: 0
Views: 142
Reputation: 16348
I wouldn't use inheritance for that. Your requirements just need some user rights support. It's not even a DDD issue and what you're suggesting are not aggregates, but at most entities.
Anyway, the point is you'd have rights and groups (roles) which have specific rights. When you need to do something, you just check the current user's rights then proceed or forbid.
I'd use the same approach, no matter if I'd use DDD/OOP or not.
Upvotes: 1