berkayyazici / UrlShortener

0 stars 0 forks source link

Determining Project Structure #2

Open eyazici90 opened 1 month ago

eyazici90 commented 1 month ago

Context

Take inspiration from the following project structure by following the same naming conventions & project structure; https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore

For sake of simplicity, we may merge some of the layer into one as below;

[!NOTE] Notice Application.Contracts & Application are merged into one as Application Same for Domain.Shared & Domain into Domain

/src/
  UrlShortener.Application
  UrlShortener.Domain
  UrlShortener.HttpApi
  UrlShortener.EfCore
/test/
...

When it comes to the layer dependencies, check all .csproj files to follow the same convention. For instance; EFcore only depends Domain layer. Same for the Application layer as well.

The top-to bottom request flow should follow the path through the project as follows:


Outside Http Call --> UrlShortener.HttpApi.{Controller} -->  UrlShortener.Application.{Service} --> UrlShortener.Domain.{Repository} --> UrlShortener.Domain.{Object}
berkayyazici commented 1 month ago

I made some minor updates about project structure and naming conventions. I could not check layer dependencies yet, but I will fix it asap. Could u take a look when you are available ?

eyazici90 commented 1 month ago

I made some minor updates about project structure and naming conventions. I could not check layer dependencies yet, but I will fix it asap. Could u take a look when you are available ?

I reviewed it again. It definitely looks better than before. However, there are some things that need a bit more fixing. I strongly advise you to read through https://abp.io/docs/latest/solution-templates/layered-web-application#solution-structure carefully & ask any questions remaining. It has a good description of the dependencies & responsibilities of each layer as well as which class needs to go where type of questions. 

If you follow the instructions from the doc above ☝️ u will realize that ur repository interfaces should live inside Domain & their Efcore impl should go towards EfCore layer. Application should consist of app-services & dtos as they suggest.

Let me know if u have any further questions or any part that is not quite clear to u @berkayyazici .

berkayyazici commented 1 month ago

I read the doc and reviewed GitHub repo about that doc (https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore), but I got some questions.

There are some missing implementations because of their framework I guess. I got some errors while trying to run app. There is IUrlRepository in Domain but no UrlRepository class. It gives Dependency Injection error.

I'm going to look back again about DDD and those dependencies for better understanding.

You can check updates about structure design in last PR. @eyazici90