Domain Driven Design Implementation – architectural patterns (part 2)

Expert workshop is something more than a training. Workshop is focused on client's project.

Code: DDD-impl
Category: DDD Workshop
Format: 50% lecture / 50% workshop
Duration: 2 days
Target audience: developers
Enrollment: Groups, companies
Venue: Client's office.

Pragmatic approach to the DDD implementation in selected technology: Java, NET, PHP, RoR.Scope

Technical aspects of the DDD implementation
  • application architecture: managing complexity thanks to separation of logic,
  • system architecture: integration of modules, event architecture that increases responsiveness and opens for plug-ins,
  • system scaling – CqRS architecture,
  • specific techniques of implementation using popular technological stacks,
  • best Clean Code practices and caring for high testability.
Business problems modeling techniques

DDD modeling techniques (strategic and tactical patterns as well as linguistic and visual techniques) are being talked over at the DDD-modeling training, which should be done first, before the training in the field of implementation.Form

The training is based on a model created during the training in the field of modeling, which precedes this training.

During lectures, the coach talks over the best practices of implementing the application architecture patterns and DDD Building Blocks.

During workshops, we implement two modules of the ERP class system. Next tasks consist of an incremental addition of new functionalities in a way that illustrates theoretical issues, learned during the lecture preceding them. During the discussions, participants have an access to the technical knowledge of the coach and have a possibility to verify their solutions with the ones developed by other participants of the training.

During workshops, participants solve the problems presented to them, working in pairs (Pair Programming), changing the roles after each task: Pilot and Driver. The purpose of this technique is to enable a look from different perspectives at the issues, at the same time activating more cognitive resources.

As a part of the training, we talk over and practice both basic and advanced DDD techniques, such as: Building Blocks patterns, developing the Ubiquitous Language and the Strategic Design technique set.

Reference project

Check out our implementation of an example DDD+CqRS project: Sample Leaven.

It's all about the content.

  • Talking over the most common errors in the implementation of Aggregates
  • Best practices and traps when using ORM and IoC
  • Modern architectures: CqRS, Event Driven, Event Sourcing

Workshop Program

The content of our program can be customised during pre-training analysis.

  1. Application architecture – practical implementation of architectural concepts
    1. Using the IoC when designing with quality in mind – design openness for extension and tests
      1. Dependency Injection – plug-ins that change the system behavior
      2. Events – plug-ins that add a new behavior
      3. AOP – orthogonal aspects (transactions, security, audits)
    2. Layer approach - arranging building blocks on layers
      1. System structuring
        1. Modules – building
        2. Packets/namespaces
      2. Presentation layer
        1. Protecting the domain from leaking to the UI
      3. Application logic
        1. Designing the API of a system
        2. Problem of the fair API – object versioning
      4. Domain logic (Building Blocks DDD)
        1. Visibility of the classes – using the packet range
      5. Infrastructure layer
        1. ORM challenges
        2. Traps of the event architecture
  2. System architecture
    1. Microservices and SOA princuples
      1. The single source of truth rule
      2. Avoiding "Corporate Model" anti-patterns
      3. Encapsulation of domain models under the Canonical Model
    2. Event Driven Architecture
      1. Avoiding Single Point of Failure
      2. Event Broker vs Events Bus
      3. Eventual Consistency - strategies
    3. The transactional events problem
  3. Tactical Patterns Implementation - Building Blocks
    1. Entities
      1. ORM mapping
      2. Base classes - Layer Superclass pattern
      3. Encapsulation
      4. Identification
    2. Aggregates
      1. Encapsulation and openness for extension
      2. Forcing the specified boundary of an aggregate
      3. Dependency Injection in Factories
      4. Challenges of the ORM
        1. Versioning
        2. Traps of Lazy Loading
        3. Mapping UML compositions – avoiding linking tables
        4. Selection of the proper collection type: Set, Bag, List
        5. (amount of SQL operations) of use of each collection type
    3. Value objects
      1. Immutability
      2. ORM mapping
    4. Domain Services
      1. Management through the IoC
    5. Repositories
      1. Dependency injection
      2. ORM aspects
        1. EAGER reading of Aggregates with a well-designed boundary
        2. Cascade writing of Aggregates with a well-designed boundary
        3. 3 approaches to optimistic locking
        4. Aggregate reading: locking READ to secure objects created on the basis of read aggregates
        5. Aggregate writing: locking WRITE of the aggregate root for logical security of the whole aggregate
      3. Transaction isolations
      4. Operations on a base class of an aggregate
        1. Versioning
        2. Problem of identification
        3. Audits - using JPA: Callbacks and Listeners
    6. Factories
      1. Factories managed by the IoC
      2. Dependency Injection into Aggregates
      3. Support for testability
      4. Managing the Coupling of Aggregates
      5. The C3 Coupling theory
        1. Call
        2. Contain
        3. Create
    7. Policies (strategies)
      1. Decorating
      2. Injecting policies as plug-ins
    8. Business events
      1. Asynchronous approach
      2. Plug-in architecture
    9. Specifications
      1. Modeling complex business conditions
      2. Filtering data in repositories
      3. Discussion on efficiency
    10. Saga/Process manager – business process model
      1. Saga management framework design
      2. Technical traps
    11. Role Object
      1. Role model – when the system should behave (not just look) differently depending on the domain role of the user
    12. Additional patterns - Building Blocks extensions
      1. Policy Decorators - Supple Design
      2. Aggregate as a state machine
      3. Chain of responsibility
      4. Builder
  4. Command-query Responsibility Segregation Architecture
    1. CqRS as a development of a layer architecture
      1. Concept of intentional GUI
      2. Two stacks of layers
    2. Write Stack
      1. Scope of responsibilities
      2. Scenarios modeling (orchestration of domain objects)
      3. Technical aspects (dependencies, transactions)
      4. Implementations
        1. Services
        2. Command and CommandHandler
      5. Using the noSQL – Document-oriented databases
    3. Read Stack
      1. Problems with efficiency of classic approaches
      2. Queries modeling
      3. Designing a read model
      4. Implementation
        1. SQL
        2. Materialized views
        3. Separate model
        4. Updating a read model
        5. graph databases
    4. Event Sourcing
      1. Sequence of events as a behavioral model
      2. Behavioral model projections on the read model
      3. Concept of Eventual Consistency
      4. Implementation of event driven Aggregates
  5. Automatic testing
    1. Testing strategy – mapping a test pyramid on application layers
      1. UI – system end-to-end
      2. Application logic – end-to-end component testing
      3. Domain logic – unit testing
        1. Testing model invariants
    2. Goal of testing
      1. Perfection and regression – domain Building Blocks unit testing
      2. Acceptance - API and UI tests
    3. Techniques
      1. Test doubles
        1. Mock – command type methods
        2. Stub – query type methods
      2. Aggregate constructors that allow to put them in any state
      3. Aggregate factories that increase the testability
      4. Managing the C3 Coupling
    4. Patterns
      1. Assembler – preparation of Aggregates
      2. Assert Object – business hypothesis of Aggregates


Download PDF

Trainers

Meet the experts who will conduct your workshop.

Contact us for a free consultation.

Firstname and lastname:
Company:
E-mail:
Phone:
Subject:
Message:

If you prefer direct contact then you can always call.

Iwona Sobótka

Training coordinator


I agree to the processing of my personal data in accordance with the Law on the Protection of Personal Data in connection with sending a request via the contact form.

Providing the data is voluntary but necessary to process the query. I have been informed that I have the right to access my data, the possibility of correcting them, demanding stopping their processing.

The administrator of personal data is Bottega IT Minds, ul. Jana Sawy 2, 20-632 Lublin, Poland.


The information clausule