jbogard / ContosoUniversityCore

MIT License
591 stars 151 forks source link

Question: Why is the domain in a different folder / namespace? #17

Closed christianarg closed 7 years ago

christianarg commented 7 years ago

Shouldn't be the domain model / entities / whateveryoucallthem be distributed among the feature modules / slices / whateveryoucallthem?

For example: ContosoUniversityCore.Domain.Course

shouldn't be located in

ContosoUniversityCore.Features.Courses.Course

/ I've modified the Feature.Course namespace to Feature.Courses in plural. Maybe that's the reason you wouldn't do this? In our company we learned to "pluralize" modules / namespaces to avoid conflict with domain objects. /

Anyway, if my suggestion is wrong, could you provide a reasoning for having the Domain in a different folder / namespace / (module?)

jbogard commented 7 years ago

Domain is shared across all features, is why. And yes, the plural name makes more sense in any case :)

christianarg commented 7 years ago

I see. Last question: If your domain was somewhat bigger would you organize Domain classes in modules / namespaces? Ex:

Features.Customer // UI, js, Controllers, Handlers Features.Shipping // UI, js, Controllers, Handlers Features.Billing // UI, js, Controllers, Handlers

Domain.Customer Domain.Shipping Domain.Billing

Or you don't see value in that? Just curious

(I'm implying we are not dividing this modules in microservices, just one well modularized monolithic app)

Thanks for your time.

jbogard commented 7 years ago

I think if I were doing a purely module based approach, this would make sense. For me though, feature folders more or less correspond to controllers, so the models don't allllllways line up.

On Tue, Aug 22, 2017 at 2:01 AM, Christian Rodriguez < notifications@github.com> wrote:

I see. Last question: If your domain was somewhat bigger would you organize Domain classes in modules / namespaces? Ex:

Features.Customer // UI, js, Controllers, Handlers Features.Shipping // UI, js, Controllers, Handlers Features.Billing // UI, js, Controllers, Handlers

Domain.Customer Domain.Shipping Domain.Billing

Or you don't see value in that? Just curious

(I'm implying we are not dividing this modules in microservices, just one well modularized monolithic app)

Thanks for your time.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbogard/ContosoUniversityCore/issues/17#issuecomment-323937641, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGYMmj3K3ZXgI7hVZN0sfecr68v-NViks5sanzbgaJpZM4O8Sg_ .