Question

I am using DDD pattern in login micro service used in employee management software. Here Organization/Company is an Entity and User is one more entity.

What are my aggregates in this case, if i think with project in mind which is login i will have only one aggregate(user aggregate) but if i think as business in my mind i will get two aggregates(Organization,User).

I might be wrong too with above aggregates. My basic question is what is the thought process when designing a aggregate in micro service? is it with respect to project or business as whole?

Was it helpful?

Solution

That depends on what you model, but I would aways focus first on the problem at hand. You can think structuraly about the data and you can think from the perspective of the actual action executed. Focus on the User and the Account related to it. What is the minimum requirement for Login. Can a user login twise based on organization ? If not than it is just the user. If you can actually login twise and you have two or more separate accounts for each organization things change. Organization becomes part of your login process.

Look at Stackoverflow Teams. You can log in individually to each team space based on the organization/company that has purchased account. Each organization will have then a separate login, account and space per.

Licensed under: CC-BY-SA with attribution
scroll top