0% found this document useful (0 votes)
2 views

HW3

hw33
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HW3

hw33
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Homework 3: Designing the ‘Register for a Class’ Use-

Case in the Course Registration Context


Due Date: January 12, 2025

Introduction

For the University Registration Project, assume a bounded context specifically for course
registration for students, referred to as the Course Registration Context.

Your task is to design the ‘Register for a Class’ use case initiated by a student. You will
work through the requirements, tactical design, and implementation details using
Domain-Driven Design (DDD), GRASP patterns, and modern architectural principles
such as the Port and Adapter Pattern. Ensure you justify all your design decisions in your
final report.

Assignment Tasks

Part 1: Write the Use Case

1. Define the Use Case:


a. Write a detailed description of the ‘Register for a Class’ use case.
b. Include:
i. Preconditions: Define the system and user state required before the
use case can execute (e.g., active registration period, student
eligibility).
ii. Postconditions: Specify the system state after successful or
unsuccessful execution of the use case (e.g., student is enrolled in
the course offering, error messages if registration fails).
2. Domain Rules:
a. Define the business rules that govern this use case. Examples include:
i. Prerequisites for the course.
ii. Enrollment capacity.
b. Reference these rules explicitly within your use case.

Part 2: Apply Tactical Design

1. Identify Domain Objects:


a. Define the following objects that will participate in the implementation of the
use case:
i. Entities: Specify their attributes and behaviors.
ii. Aggregates: Clearly define the aggregate boundaries and identify the
root entities.
iii. Domain Services: Define services for behaviors that do not belong to
a specific entity or value object.
iv. Value Objects: Specify objects that represent immutable concepts in
the domain.
v. Domain Events: Identify any domain events that need to be raised
during the execution of the use case (e.g., ClassRegistered event).
2. Explain Aggregate Boundaries:
a. Justify how the defined aggregate boundaries ensure data consistency and
align with the domain rules you specified in Part 1.

Part 3: Design the Use Case

1. Draw the UML Sequence Diagram:


a. Illustrate the step-by-step execution of the ‘Register for a Class’ use case.
b. Ensure the diagram shows:
i. Interaction between the layers (application layer, domain model
layer, and infrastructure layer).
ii. The role of the domain objects identified in Part 2.
iii. Usage of the Port and Adapter Pattern for separation of concerns.
iv. Application of GRASP Patterns for responsibility assignment (e.g.,
Controller, Information Expert, Creator).
v. Use of the Unit of Work Pattern to ensure atomicity of operations.
vi. Explain how the defined domain rules are implemented in the design
2. Eventual Consistency:
a. If the use case involves eventual consistency , use a message bus to
implement it. Show this in your diagram.
3. Explain Design Decisions:
a. In your report, explain all design decisions made during the design phase,
including:
i. How the Port and Adapter Pattern ensures domain model
independence from infrastructure.
ii. How you applied GRASP Patterns to assign responsibilities
effectively.
iii. The use of the Unit of Work Pattern to manage transactional
operations.
4. Write Code of the Application Service Class:
a. Give the Python code of the Application Service Class for the ‘Register for
a Class’ use case.
b. The application service should:
i. Coordinate between the layers (e.g., calling repositories, invoking
domain services).
ii. Handle validation and error handling at the application level.
iii. Execute domain events if necessary.
c. Write clear, well-documented code following best practices.
5. Explain the Code:
a. Describe how your application service interacts with other components,
including:
i. Repositories.
ii. Domain objects (aggregates, entities, and value objects).
iii. External systems through adapters.

Deliverables

1. Use-Case Description:
a. Clearly written use-case details, including preconditions, postconditions,
and domain rules.
2. Tactical Design Documentation:
a. Definitions of all tactical pattern objects (entities, aggregates, domain
services, value objects, and domain events).
b. Justification for aggregate boundaries.
3. UML Sequence Diagram:
a. A detailed diagram illustrating the flow of the use case, showcasing the
interaction of domain objects, patterns, and architectural principles.
4. Application Service Code:
a. Well-structured, commented code for the application service class.
b. Explanation of how the application service operates and interacts with other
components.
5. Design Report:
a. A comprehensive explanation of your design decisions, including:
i. How each pattern was applied.
ii. How eventual consistency was managed (if applicable).
iii. Benefits of the design in terms of maintainability, scalability, and
separation of concerns.

You might also like