ABP
SIMPLE, YOU WILL NEVER HEAR AGAIN CHAMITH SARANGA
What is ABP
 ASP.net core Startup template.
 Designing Using Domain Driven Designing.
 Include development best practices.
 Fee.
 Has infrastructure for necessary development tools.
Has infrastructure for necessary
development tools
1. Caching(redis).
2. Logging(Log4net).
3. Dependency injection (Castle Windsor ).
4. Object mapping (Automapper)
5. Sending emails(Mailkit).
6. Odata integration.
7. Background process integration (Hangfire).
8. Localization
9. Authorization (Identity Server)
10. Auditing.
11. Swagger.
Create sample ABP Project
Demo
Domain Driven
Deigning
Tactical tool
DDD Tactical tool and ABP feature
No DDD ABP
1 Entity Entity
2 Value Object Value Object
3 Aggregates Aggregate root, event bus , Domain Services
4 Services ApplicationServices
5 Repository Repository
6 Layard architecture Layard architecture
ABP Layers and responsibilities
Layer Responsibility Tools
Core 1. Core Layer
2. Manage Domain (Business).
3. Manage Entities.
4. Manage business rules.
5. Manage Aggregates
1. Entity
2. Aggregates.
3. Value Object.
4. Entity Relations.
Application 1. Orchestrate Entity
2. Manage Repository (DB)
3. Manage Transaction
4. Manage Cache
5. Manage Log
6. Audit Logging
1. ApplicationService.
2. Repository
3. UnitOfWork
4. Dto.
5. IObjectMapper.
6. ICacheManager
Api 1. Orchestrate Application Services.
2. Authorization
3. Routing.
4. Object Validation.
5. Query Data
6. Manage http Pipeline middleware
1. Odata
2. Authorization Attrib*
3. Validate Attrib*
4. Data Anotation
5. Route.
6. Startup.
Entity
 Represent business entity , there properties and method.
 All should be inherit by Entity class.
 All properties must be Private or protected set. NOT PUBLIC.
 All properties assign values inside the class.
 All Business logics must be inside Entity class.
 Use Ubiquitous Language for named properties and methods.
 Use Aggregate roots and aggregates entities for group Entity (Bounded context)
 Aggregate Root is main entry point to related entities. That mean entities can update
withing only aggregate root. Total aggregate behave like atomic transaction (Unit of
work)
Configure related table name
1. Base class.
2. Inbuild PK (default int)
3. Generic type available.
Entity<Guid>
Describe property of column
Prevent malicious set
Default constructor
1. Create a person.
2. Apply Business rules
1. Update the person.
2. Apply Business rules
Value object
Make objects compare on value rather than
references
Characteristics
1. No ID.
2. Immutable.
Similar
1. Struct
2. ComplexType
Example :- Name,Address
Step 1 : Create Value Object Step 2 :Refer value object from Entity
Step 3 : Create Map on Entity framework
Final Result
Entity With aggregates, Relations and
Domain event
Demo
Application
Service
continue.
Middleware between API and domain layer.
Orchestrating Domain layer.
Handle Database transaction.
Automatically resolve the dependencies by ABP
framework.
ApplicationService
Application Layer
Domain Layer
Presentation layer
Dto
Dto
Repository
Middleware between Domain and Data Access Layer (Db context).
Domain
Service Repository
DbContext +
Database
Repository Example
Custom repository
Querying (Single entity)
Querying List of entities
Or
Insert
Update
Delete
Others
Unit of work
 Handle transaction between two or more repositories.
 Following Senarios are unit of work by defaule
 Application Service methods
 Repository method
Application Service methods (UOW)
Repository (UOW)
Both IPersonRepository and IStatisticsRepository shared same transaction. If no exception
both commit, else both roleback.
Explicitly unit of work
1
Explicitly unit of work
2
Utilities Caching
Loggin
Object to object mapping.
Mailkit
Swagger
Background Process (hangfire)
SignalR

Asp.net boilerplate

  • 1.
    ABP SIMPLE, YOU WILLNEVER HEAR AGAIN CHAMITH SARANGA
  • 2.
    What is ABP ASP.net core Startup template.  Designing Using Domain Driven Designing.  Include development best practices.  Fee.  Has infrastructure for necessary development tools.
  • 3.
    Has infrastructure fornecessary development tools 1. Caching(redis). 2. Logging(Log4net). 3. Dependency injection (Castle Windsor ). 4. Object mapping (Automapper) 5. Sending emails(Mailkit). 6. Odata integration. 7. Background process integration (Hangfire). 8. Localization 9. Authorization (Identity Server) 10. Auditing. 11. Swagger.
  • 4.
    Create sample ABPProject Demo
  • 5.
  • 6.
    DDD Tactical tooland ABP feature No DDD ABP 1 Entity Entity 2 Value Object Value Object 3 Aggregates Aggregate root, event bus , Domain Services 4 Services ApplicationServices 5 Repository Repository 6 Layard architecture Layard architecture
  • 7.
    ABP Layers andresponsibilities Layer Responsibility Tools Core 1. Core Layer 2. Manage Domain (Business). 3. Manage Entities. 4. Manage business rules. 5. Manage Aggregates 1. Entity 2. Aggregates. 3. Value Object. 4. Entity Relations. Application 1. Orchestrate Entity 2. Manage Repository (DB) 3. Manage Transaction 4. Manage Cache 5. Manage Log 6. Audit Logging 1. ApplicationService. 2. Repository 3. UnitOfWork 4. Dto. 5. IObjectMapper. 6. ICacheManager Api 1. Orchestrate Application Services. 2. Authorization 3. Routing. 4. Object Validation. 5. Query Data 6. Manage http Pipeline middleware 1. Odata 2. Authorization Attrib* 3. Validate Attrib* 4. Data Anotation 5. Route. 6. Startup.
  • 8.
    Entity  Represent businessentity , there properties and method.  All should be inherit by Entity class.  All properties must be Private or protected set. NOT PUBLIC.  All properties assign values inside the class.  All Business logics must be inside Entity class.  Use Ubiquitous Language for named properties and methods.  Use Aggregate roots and aggregates entities for group Entity (Bounded context)  Aggregate Root is main entry point to related entities. That mean entities can update withing only aggregate root. Total aggregate behave like atomic transaction (Unit of work)
  • 9.
    Configure related tablename 1. Base class. 2. Inbuild PK (default int) 3. Generic type available. Entity<Guid> Describe property of column Prevent malicious set Default constructor 1. Create a person. 2. Apply Business rules 1. Update the person. 2. Apply Business rules
  • 10.
    Value object Make objectscompare on value rather than references Characteristics 1. No ID. 2. Immutable. Similar 1. Struct 2. ComplexType Example :- Name,Address
  • 11.
    Step 1 :Create Value Object Step 2 :Refer value object from Entity Step 3 : Create Map on Entity framework
  • 12.
  • 13.
    Entity With aggregates,Relations and Domain event Demo
  • 14.
    Application Service continue. Middleware between APIand domain layer. Orchestrating Domain layer. Handle Database transaction. Automatically resolve the dependencies by ABP framework.
  • 15.
  • 17.
    Repository Middleware between Domainand Data Access Layer (Db context). Domain Service Repository DbContext + Database
  • 18.
  • 19.
  • 20.
  • 21.
    Querying List ofentities Or
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
    Unit of work Handle transaction between two or more repositories.  Following Senarios are unit of work by defaule  Application Service methods  Repository method
  • 27.
  • 28.
    Repository (UOW) Both IPersonRepositoryand IStatisticsRepository shared same transaction. If no exception both commit, else both roleback.
  • 29.
  • 30.
  • 31.
    Utilities Caching Loggin Object toobject mapping. Mailkit Swagger Background Process (hangfire) SignalR

Editor's Notes

  • #11 Why no id. Why immutable , why not struct. It is not only for db operations