O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Architectural Patterns

Book Description

Learn the importance of architectural and design patterns in producing and sustaining next-generation IT and business-critical applications with this guide.

About This Book

  • Use patterns to tackle communication, integration, application structure, and more
  • Implement modern design patterns such as microservices to build resilient and highly available applications
  • Choose between the MVP, MVC, and MVVM patterns depending on the application being built

Who This Book Is For

This book will empower and enrich IT architects (such as enterprise architects, software product architects, and solution and system architects), technical consultants, evangelists, and experts.

What You Will Learn

  • Understand how several architectural and design patterns work to systematically develop multitier web, mobile, embedded, and cloud applications
  • Learn object-oriented and component-based software engineering principles and patterns
  • Explore the frameworks corresponding to various architectural patterns
  • Implement domain-driven, test-driven, and behavior-driven methodologies
  • Deploy key platforms and tools effectively to enable EA design and solutioning
  • Implement various patterns designed for the cloud paradigm

In Detail

Enterprise Architecture (EA) is typically an aggregate of the business, application, data, and infrastructure architectures of any forward-looking enterprise. Due to constant changes and rising complexities in the business and technology landscapes, producing sophisticated architectures is on the rise. Architectural patterns are gaining a lot of attention these days.

The book is divided in three modules. You'll learn about the patterns associated with object-oriented, component-based, client-server, and cloud architectures. The second module covers Enterprise Application Integration (EAI) patterns and how they are architected using various tools and patterns. You will come across patterns for Service-Oriented Architecture (SOA), Event-Driven Architecture (EDA), Resource-Oriented Architecture (ROA), big data analytics architecture, and Microservices Architecture (MSA). The final module talks about advanced topics such as Docker containers, high performance, and reliable application architectures. The key takeaways include understanding what architectures are, why they're used, and how and where architecture, design, and integration patterns are being leveraged to build better and bigger systems.

Style and Approach

This book adopts a hands-on approach with real-world examples and use cases.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
      1. Downloading the color images of this book
      2. Errata
      3. Piracy
      4. Questions
  2. Demystifying Software Architecture Patterns
    1. Envisioning the software-defined world
    2. Software patterns
      1. Why software patterns?
      2. The prime ingredients of a software pattern
      3. The types of software patterns
    3. Software architecture patterns
      1. Object-oriented architecture (OOA)
      2. Component-based assembly (CBD) architecture
      3. Domain-driven design (DDD) architecture
      4. Client/server architecture
      5. Multi-tier distributed computing architecture
      6. Layered/tiered architecture
      7. Event-driven architecture (EDA)
        1. The major issues with EDA
      8. Service-oriented architecture (SOA)
        1. Service-inspired integration (SOI)
      9. Event-driven service-oriented architecture
    4. The EDA fundamental principles
    5. The ED-SOA composite pattern benefits
    6. Microservices architecture (MSA)
    7. Event-driven microservices patterns
    8. Space-based architecture (SBA)
    9. Combining architecture patterns
    10. Special-purpose architectures
    11. Real-time context-aware prediction architecture
    12. Summary
    13. Additional reading materials
  3. Client/Server Multi-Tier Architectural Patterns
    1. Domain name service (DNS) server and DNS client
      1. The workings of a DNS
    2. Functional requirements in two-tier client-server patterns
      1. Distribution of functional requirements in a client-server pattern
        1. The remote data access client-server pattern
        2. The remote presentation client-server pattern
        3. The split logic data client-server architecture pattern
    3. The three-tier pattern / multi-tier pattern client-server
      1. The master-slave pattern
        1. Issues in the master-slave pattern
      2. Peer-to-peer patterns
      3. Advantages of two-tier client-server patterns
      4. Design considerations - when to use a two-tier client-server pattern?
      5. Limitations of two-tier client-server patterns
    4. Three-tier client-server architecture
      1. Design considerations for using three-tier architecture
      2. Design considerations for n-tier architecture
        1. An example of n-tier architecture (shopping cart web application)
    5. The distributed client-server architecture
    6. Motivation for development of web application patterns
      1. Workings of the MVC pattern
    7. The ASP.Net framework
      1. The model view presenter (MVP) pattern
      2. The model-view-viewmodel (MVVM) pattern
        1. Key advantages of the MVVM pattern
        2. Design considerations for using the MVVM pattern
        3. Prism
    8. Design patterns for web application development
      1. The front controller pattern
      2. Spring framework
    9. Summary
  4. Object-Oriented Software Engineering Patterns
    1. Key elements of OOD
      1. Additional elements of OOD
    2. Design principles
      1. Single responsibility principle (SRP) – SOLID
      2. Open and close principle – SOLID
      3. Liskov substitution principle (LSP) – SOLID
      4. Interface segregation principle (ISP) – SOLID
      5. Dependency inversion principle (DIP) – SOLID
      6. Other common design principles
    3. OO design patterns
      1. Creational design patterns
        1. Factory method (virtual constructor)
        2. Abstract factory (kit)
        3. Builder
        4. Prototype
        5. Singleton
      2. Structural design patterns
        1. Adapter class (wrapper)
        2. Adapter (object)
        3. Bridge (handle/body)
        4. Composite
        5. Decorator
        6. Façade
        7. Flyweight
        8. Proxy
      3. Behavioral patterns
        1. Chain of responsibility
        2. Command (action/transaction)
        3. Interpreter
        4. Iterator (cursor)
        5. Mediator
        6. Memento
        7. Observer (dependents/publish/subscribe)
        8. State (objects for states)
        9. Strategy (policy)
        10. The template method
        11. Visitor
    4. Concurrency patterns
      1. Concurrency design pattern
        1. Producer-consumer
        2. Active object
        3. Monitor object
      2. Concurrency architectural pattern
    5. Summary
    6. References
  5. Enterprise Integration Patterns
    1. Need for integration patterns
    2. Integration scenarios in enterprises
      1. Information portal
      2. Data replication
      3. Shared business function
      4. Service-oriented architecture
      5. Distributed business process management
      6. The business-to-business integration
    3. Main challenges in enterprise integration
      1. File transfer
      2. Shared database
      3. Remote procedure invocation
      4. Messaging
    4. Getting started with messaging patterns
    5. Pipe and filter pattern
    6. Message router pattern
    7. Message translator pattern
    8. Message endpoint pattern
    9. Point-to-point channel pattern
    10. Publish-subscribe channel pattern
    11. Datatype channel pattern
    12. Message bus patterns
    13. Command message patterns
    14. Event message patterns
    15. Request-reply pattern
    16. Content-based router pattern
    17. Message filter pattern
    18. Resequencer pattern
    19. Polling consumer pattern
    20. Channel adapter
    21. Mobile integration pattern
    22. Request-response pattern
    23. Defining a push notification pattern
    24. API management pattern
    25. Summary
  6. Domain-Driven Design (DDD) Principles and Patterns
    1. Principles, characteristics, and practices of DDD
      1. Principles
        1. Focusing on the core domain
        2. Collaborate and learn
        3. Model the domain
        4. Evolve
        5. Talk in ubiquitous language
      2. Characteristics
      3. Best practices
    2. DDD patterns
      1. Strategic patterns
        1. Ubiquitous language
        2. Domain, subdomain, and core domain
        3. Bounded contexts
    3. Integrating bounded contexts
      1. Autonomous bounded context
      2. The shared-nothing architecture
      3. Single responsibility codes
      4. Multiple bounded contexts (within a solution)
      5. Adoption of SOA principles
    4. Integrating with legacy systems
      1. The bubble context
        1. The anti-corruption layer
      2. Expose as a service
    5. Distributed bounded context integration strategies
      1. Database integration
      2. Flat file integration
      3. Event-driven architecture and messaging
    6. Tactical patterns
    7. Patterns to model the domain
      1. Entities
      2. Value objects
      3. Domain services
      4. Modules
      5. Aggregates
      6. Factories
      7. Repositories
    8. Emerging patterns
      1. Domain events
      2. Event sourcing
      3. Other patterns
    9. Summary
    10. References and further reading materials
  7. Enterprise Architecture Platforms and Tools
    1. Overview of enterprise architecture frameworks
    2. Getting started with TOGAF
    3. Architecture development method (ADM)
    4. Deliverables, artifacts, and building blocks
    5. Enterprise continuum
    6. Architecture repository
      1. Advantages of using TOGAF
      2. Limitations of TOGAF
    7. Zachman framework for enterprise architecture
      1. Advantages
      2. Restrictions
      3. Guidelines for choosing EAF
    8. Enterprise architecture platforms and tools
    9. Enterprise Architect from Sparx Systems
    10. Dragon1
    11. ABACUS from avolution software
      1. Architecture of ABACUS
    12. Summary
    13. References
  8. Service-Oriented Architecture (SOA)
    1. Web services and SOA
    2. Introduction to SOA
    3. Life cycle of SOA
    4. Primary characteristics of SOA
      1. Service interconnectivity with well-defined interfaces
      2. Standard interfaces and Service level agreements
      3. Event-driven and messaging
      4. Flexible
      5. Evolution
    5. Principles of SOA
      1. Standardized service contract
      2. Service interoperability
      3. Service abstraction
      4. Service autonomy
      5. Service composability
      6. Service discoverability
      7. Service loose coupling
      8. Service reusability
      9. Service statelessness
    6. SOA design patterns
      1. Service messaging
      2. Message screening
      3. Agnostic services
      4. Atomic service transaction
      5. Authentication broker
      6. Message origin authentication
      7. Service façade
      8. Multiple service contract
      9. Service callback
      10. Event-driven messaging
      11. Service refactoring
      12. Metadata centralization
      13. Principles and patterns cross reference
    7. Summary
  9. Event-Driven Architectural Patterns
    1. Service-oriented architecture and event-driven architecture (SOA versus EDA)
    2. Key characteristics of event-driven patterns
      1. Components of an EDA pattern
    3. Event flow layers
      1. Event generators
      2. Event channel
      3. Event processing
      4. Downstream event-driven activity
    4. Design considerations for event-driven patterns
    5. Implementation variants of EDA patterns
      1. Simple event processing patterns
      2. Event stream processing patterns
      3. Complex event processing (CEP) patterns
    6. Types of event-driven patterns
      1. Event mediator topology pattern
      2. Event broker topology pattern
        1. Hub and spoke pattern
      3. Broadcast pattern
      4. Polling pattern
    7. EDA pattern implementation in systems/processes
      1. Event log
      2. Event collectors
      3. Reply queue
    8. Improving the performance of EDA-based processes/systems
    9. IBM WebSphere MQ
    10. Emerging trends in EDA
      1. Event-driven microservices
      2. Complex event processing
      3. Internet of Things (IoT) and EDA
    11. References
    12. Summary
  10. Microservices Architecture Patterns
    1. Microservices patterns
      1. Decomposition patterns
        1. Decomposition by use case pattern
        2. Decomposition by resources pattern
        3. Decomposition by business capability pattern
        4. Decomposition by subdomain pattern
      2. Microservices deployment pattern
        1. Multiple service instances per host pattern
        2. Single service instance per host pattern
        3. Service instance per VM pattern
        4. Service instance per container pattern
        5. Serverless deployment pattern
        6. Service deployment platform pattern
      3. Microservices design patterns
        1. Aggregator microservice design pattern
        2. Proxy microservice design pattern
        3. Chained microservice design pattern
        4. Microservice chassis pattern
        5. Externalized configuration pattern
      4. Microservices database patterns
        1. Database per service pattern
        2. Shared data design pattern
        3. Shared database pattern
        4. Command-query responsibility segregation (CQRS) pattern
      5. Microservices integration patterns
    2. Remote procedure invocation (RPI) pattern
    3. Messaging design pattern
      1. Asynchronous messaging design pattern
    4. Domain-specific protocol pattern
    5. API gateway pattern
      1. Backend for frontend pattern
      2. Microservices registration, discovery, and usage patterns
    6. Service discovery pattern
    7. Service registry pattern
    8. Service registration pattern
    9. Event-driven architecture (EDA) patterns
    10. Event sourcing pattern
    11. Transaction log tailing pattern
    12. Publishing events using the database trigger pattern
    13. Application publishes events pattern
    14. Testing and troubleshooting patterns
    15. Access token pattern
    16. Service component test pattern
    17. Log aggregation pattern
    18. Application metrics pattern
      1. Audit logging pattern
    19. Distributed tracing pattern
      1. Exception tracking pattern
    20. Health check API pattern
      1. Microservices composition patterns
        1. Server-side page fragment composition pattern
        2. Client-side UI composition pattern
        3. Messaging-based microservices composition pattern
      2. Resilient and reliable microservices patterns
    21. Circuit breaker pattern
      1. Shared caching layer pattern
      2. High availability microservices pattern
      3. Concurrent requests for data pattern
      4. Event store pattern
        1. Event streams and the unified event log pattern
          1. Asynchronous command calls pattern
    22. Summary
  11. Patterns for Containerized and Reliable Applications
    1. Introduction
      1. The key drivers for containerization
      2. Design patterns for Docker containers
      3. Container building patterns
    2. Docker image building patterns
    3. Multi-stage image building pattern
    4. The pattern for file sharing between containers 
      1. Using bind-mount volumes
    5. Pipes and filters pattern
    6. Containerized applications - Autopilot pattern
    7. Containers - persistent storage patterns
      1. The context for persistent storages
      2. The persistent storage options
      3. Volumes
      4. Bind mounts
      5. The tmpfs mounts
    8. Docker compose configuration pattern
    9. Docker container anti-patterns
      1. Installing an OS inside a Docker container 
      2. Go for optimized Docker images
      3. Storing container images only inside a container registry
      4. Hosting only one service inside a container
      5. Latest doesn't mean best
      6. Docker containers with SSH
      7. IP addresses of a container
      8. Root user
      9. Dependency between containers
    10. Patterns for highly reliable applications
    11. Resiliency implementation strategies
      1. The testing approaches for resiliency
      2. The resilient deployment approaches
      3. The deployment patterns
      4. Monitoring and diagnostics
      5. Resiliency realization patterns
        1. Circuit breaker pattern
        2. Bulkhead pattern
        3. Compensating transaction pattern
        4. Health endpoint monitoring pattern
        5. Leader election pattern
        6. Queue-based load leveling pattern
        7. Retry pattern
    12. Summary
  12. Software-Defined Clouds - the Architecture and Design Patterns
    1. Reflecting the cloud journey
    2. Traditional application architecture versus cloud application architecture
      1. The traditional application architecture
      2. The cloud architecture
      3. The cloud application architecture
    3. Cloud integration patterns
      1. Tier/Layer-based decomposition
      2. Process-based decomposition
      3. Pipes-and-filters-based decomposition
      4. Service messaging pattern
      5. Messaging metadata pattern
      6. Service agent pattern
      7. Intermediate routing pattern
      8. State messaging pattern
      9. Service callback pattern
      10. Service instance routing
      11. Asynchronous queuing pattern
      12. Reliable messaging pattern
    4. Cloud design patterns
      1. Cache-aside pattern
      2. Circuit breaker pattern
      3. Compensating transaction pattern
      4. Competing consumers pattern
      5. Compute resource consolidation pattern
      6. Command and query responsibility segregation (CQRS) pattern
      7. Event sourcing pattern
      8. External configuration store pattern
      9. Federated identity pattern
      10. Gatekeeper pattern
      11. Application health monitoring pattern
      12. Leader election pattern
      13. Materialized views pattern
      14. Pipes and filters pattern
      15. Priority queue pattern
      16. Queue-based load leveling pattern
      17. Retry pattern
      18. Runtime reconfiguration pattern
      19. Scheduler agent supervisor pattern
      20. Sharding pattern
      21. Throttling pattern
      22. Workload distribution pattern
      23. Cloud workload scheduler pattern
    5. Cloud reliability and resilience patterns
      1. Resource pooling pattern
      2. Resource reservation pattern
      3. Hypervisor clustering pattern
      4. Redundant storage pattern
      5. Dynamic failure detection and recovery pattern
      6. Redundant physical connection for virtual servers pattern
    6. Cloud security patterns
      1. Cryptographic key management system pattern
      2. Virtual private network (VPN) pattern
      3. Cloud authentication gateway pattern
      4. In-transit cloud data encryption pattern
      5. Cloud storage device masking pattern
      6. Cloud storage data at rest encryption pattern
      7. Endpoint threat detection and response pattern
      8. Threat intelligence processing pattern
      9. Cloud denial of service (DoS) protection pattern
    7. Summary
    8. Bibliography
  13. Big Data Architecture and Design Patterns
    1. The four V's of big data
    2. Big data analysis and technology concepts
      1. Data analysis life cycle
    3. Big data analysis and data science
      1. Data analysis
      2. Data science
    4. Big data platform
      1. Big data engineering
      2. Big data governance
    5. Big data architecture landscape and layers
    6. Big data architecture patterns
      1. MapReduce pattern
      2. Lambda architecture pattern
      3. Data lake architecture pattern
    7. Big data design patterns
      1. Data sources and ingestion layer
        1. Multisource extractor
        2. Multidestination pattern
        3. Protocol converter
        4. Just-In-Time (JIT) transformation pattern
        5. Real-time streaming pattern
      2. Big data workload patterns
      3. Data storage layer
        1. ACID versus BASE versus CAP
        2. Façade pattern
        3. NoSQL pattern
        4. Polyglot pattern
      4. Data access layer
        1. Connector pattern
        2. Lightweight stateless pattern
        3. Service locator pattern
        4. Near real-time pattern
        5. Stage transform pattern
        6. Rapid data analysis pattern
        7. Data discovery and analysis layer
        8. Data queuing pattern
        9. Index-based insight pattern
        10. Machine learning pattern
        11. Converge(r) pattern
        12. Data visualization layer
        13. First glimpse pattern
        14. Portal pattern
        15. Mashup view pattern
        16. Compression pattern
        17. Exploder pattern
    8. Summary
    9. References