ABP框架中的代码是如何组织的?

How is code organized in the ABP framework?

组织代码有点疑惑。我看到了两种组织代码的方式:package by layerpackage by componenthttp://www.codingthearchitecture.com/2015/03/08/package_by_component_and_architecturally_aligned_testing.html

ABP框架本身并不要求采用特定的形式,两种形式似乎都支持。 ABP框架给的sample中只能看到package by layer。不清楚package by component能不能用

例如,有三个边界上下文:订单、产品和客户。

如果使用package by layer,则如下图

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

如果使用package by component,则如下图

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

哪种方法在ABP框架中使用比较广泛?

ASP.NET 样板使用 package by layer 或“领域驱动设计层”。
https://aspnetboilerplate.com/Pages/Documents/NLayer-Architecture

这是可在 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/