Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This solution need more separation of concerns #2

Open
Alipoustdouzan opened this issue Aug 4, 2023 · 0 comments
Open

This solution need more separation of concerns #2

Alipoustdouzan opened this issue Aug 4, 2023 · 0 comments

Comments

@Alipoustdouzan
Copy link

Dear NilavPatel,
Thank you for this sample, But i think this solution need more separation of concerns, I will explain where and why.

  1. Data and services both are in one project, This make it hard to refactor or changing technology for specific part, For example if i want to change my DBProvider from EFCore to MondoDb, I need to create new project for infrastructure which contain EmailService and LoggerService, These kind of code should be separated.

  2. Application layer should only orchestrate whole application, It should contain any interface of any service, All interface and contracts should be in domain layer, But i suggest create domain layer as folder because domain layer should have more than one project.
    Example :
    MyApp.Domain.Data
    MyApp.Domain.Service
    MyApp.Domain.Shared
    MyApp.Domain.Contract

  3. Same thing should happen to infrastructure layer, It need to be a folder which contains :
    MyApp.Infrastructure.DataEFCore
    MyApp.Infrastructure.Service
    (if you want to separate even better : MyApp.Infrastructure.LoggerService, MyApp.Infrastructure.EmailService)

If you do this, You be abble change your DBProvider easily by adding another project like MyApp.Infrastructure.DataMongoDb without implement your EmailService and LoggerService, You only need to call another dependency resolver in your WebApi project.

About MyApp.DbMigrations i have to say i didn't get why this project exists, This logic and code should be in MyApp.Infrastructure.DataEFCore project.

The whole solution could be something like this :
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant