2

I have some doubts about organizing code. I see two ways of organizing code: package by layer and package by component. http://www.codingthearchitecture.com/2015/03/08/package_by_component_and_architecturally_aligned_testing.html

The ABP framework itself does not require a specific form to be adopted, and both forms appear to be supported. Only package by layer can be seen in the sample given by ABP framework. It is not clear whether package by component can be used.

For example, there are three boundary contexts: order, product and customer.

If package by layer is used, it will be as shown in the figure below.

Project.sln  
  Project.Application  
    OrderContext
    ProductContext
    CustomerContext
  Project.Core  
    OrderContext
    ProductContext
    CustomerContext
  Project.EntityFrameworkCore
    ...

If package by component is used, it will be as shown in the figure below.

Project.sln  
  hosts  
    Project.Host
  modules
    orders
      Order.Application
      Order.Core
      Order.EntityFrameworkCore
    products
      Product.Application
      Product.Core
      Product.EntityFrameworkCore
    customers
      Customer.Application
      Customer.Core
      Customer.EntityFrameworkCore

Which method is more widely used in the ABP framework?

aaron
  • 39,695
  • 6
  • 46
  • 102
SAssassin
  • 23
  • 3

1 Answers1

0

ASP.NET Boilerplate uses package by layer or "Domain Driven Design Layers".
https://aspnetboilerplate.com/Pages/Documents/NLayer-Architecture

Here is the folder structure of the official template downloadable at https://aspnetboilerplate.com/Templates with the source code hosted at https://github.com/aspnetboilerplate/module-zero-core-template:

AbpCompanyName.AbpProjectName.sln
src/
  AbpCompanyName.AbpProjectName.Application/
    Authorization/
    Configuration/
    MultiTenancy/
    Roles/
    Users/
  AbpCompanyName.AbpProjectName.Core/
    Authorization/
      Roles/
      Users/
    Configuration/
    MultiTenancy/
aaron
  • 39,695
  • 6
  • 46
  • 102
  • @SAssassin Read the rest of the answer. – aaron Oct 22 '20 at 01:21
  • Thank you. I think I found the answer. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1476#issuecomment-277330004 ABP framework can be ```package by components``` and has been embodied in ABP vNext. – SAssassin Oct 25 '20 at 13:08