02 Reusable Assets and Frameworks

Reusable Assets and Frameworks

  • Objectives:

    • Design reusable components (assets) through Domain Analysis.

    • Create common services for applications.

    • Architect frameworks for application development.

Key Topics

  • Reusable Assets in Platforms

  • Reusable Services

  • Reusable Frameworks

  • Shared Libraries

Reusable Assets in Platforms

  • Services: Reusable across features (e.g., Customer service used in Purchase/Delivery).

  • Frameworks: Support building multiple clients/services (e.g., Spring Boot).

  • Shared Libraries: For sharing common entities across clients/services, lesser reuse than frameworks.

Characteristics of Reusable Services

  • Maintainable, extensible, resilient.

  • Cohesion and single-minded focus (Single Responsibility Principle).

  • Decoupled architecture, message-driven for loose coupling.

  • Horizontally scalable.

Identifying Reusable Services

  • Align with business requirements.

  • Use Domain-Driven Design (DDD) for effective service identification and dependency mapping.

Domain-Driven Design (DDD) Overview

  • Focus on core domain and domain logic.

  • Collaboration between technical and domain experts.

  • Techniques: Bounded Contexts, Ubiquitous Languages.

Challenges in Identifying Reusable Services

  • Extracting services from business requirements.

  • Segregating entities and ensuring consistent naming.

  • Assigning teams and managing repositories/databases.

Bounded Contexts and Ubiquitous Language

  • Bounded Context (BC): A semantic boundary for entities.

  • Ubiquitous Language (UL): Shared language among team members for clarity.

Benefits of Bounded Contexts

  • Functional cohesion and single UL per BC.

  • Smaller test cases and clearer team responsibilities.

Characteristics of Reusable Frameworks

  • Frameworks for solving domain-specific problems.

  • Designed to be reusable across systems.

  • Examples include Spring Web MVC for web applications.

Qualities of Well-Designed Frameworks

  • Simple, testable, consistent, and integrated.

  • Evolve over time while maintaining backward compatibility.

Guidelines for Client Libraries

  • Separate client transport logic from service specifics.

  • Allow client control over library upgrades.

Summary

  • Reusable assets enhance software development productivity.

  • DDD assists in service design.

  • Avoid overuse of shared libraries to maintain flexibility in development.