Pattern-Oriented Software Architecture Frank Buschmann Kevlin Henney
Total Page:16
File Type:pdf, Size:1020Kb
Mo 2 January 21-25, 2008, Munich, Germany ICM - International Congress Centre Munich Pattern-Oriented Software Architecture Frank Buschmann Kevlin Henney Pattern-Oriented Software Architecture T H E C R A F T O F S O F TT F TO F R E W H E C R R C H I O F S A A A TT E C U R E Kevlin Henney Frank Buschmann Curbralan Limited Siemens AG [email protected] [email protected] Agenda Introduction Stand-Alone Patterns Pattern Complements / Pattern Compounds Pattern Stories / Pattern Sequences Pattern Languages P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Outroduction References Pattern-Oriented Software Architecture 2 © Frank Buschmann, Kevlin Henney, all rights reserved 1 Where we are Introduction Stand-Alone Patterns Pattern Complements / Pattern Compounds Pattern Stories / Pattern Sequences Pattern Languages P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Outroduction References Pattern-Oriented Software Architecture 3 © Frank Buschmann, Kevlin Henney, all rights reserved On Designing with Patterns (1) Patterns have become a popular tool in software design … • They have changed the way software developers think about and practice software design • They provide us with a software design vocabulary • They help us to resolve recurring problems constructively and based on proven solutions • They support us in understanding the architecture of a given software system • ... P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O But: applying patterns in software design is not necessarily designing with patterns! Pattern-Oriented Software Architecture 4 © Frank Buschmann, Kevlin Henney, all rights reserved 2 On Designing with Patterns (2) Patterns applied in isolation and as modular building blocks do not create sustainable designs. Command Processor Solutions Command Logging Logging Client • Fail to consider the surrounding Processor Context Strategy problems and their solutions. Concrete Component * Logging • Have at best only local effects. Strategy Composite • Do not complement one another Strategy or mutually reinforce their Leaf Compositen sig De beneficial properties. or Po Memento P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O • Create complex architectures Command Caretaker that lack useful operational and developmental qualities. Concrete Concrete Memento Command Command Command Application Pattern-Oriented Software Architecture 5 © Frank Buschmann, Kevlin Henney, all rights reserved On Designing with Patterns (3) There are two fundamental ways of integrating patterns: • Refinement: One pattern refines the structure and behavior of another pattern to address a specific sub-problem or implementation detail. • Combination: Two or more patterns arranged to form a larger structure that addresses a more complex problem. There are also relationships regarding choice: • Alternatives: Some patterns describe alternatives to one another. They address the same or a similar problem, but each pattern considers a slightly P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O different set of forces. Thus, the patterns provide different solutions and have different consequences. • Cooperation: Some patterns nicely complement one another, mutually reinforcing their structural and behavioral properties. Pattern-Oriented Software Architecture 6 © Frank Buschmann, Kevlin Henney, all rights reserved 3 On Designing with Patterns (4) Patterns applied by considering their relationships create balanced designs. Command Processor Strategy Solutions Command Logging Client • Consider their surrounding Processor Strategy problem and solution space. Concrete gn Logging • Have systemic effects. si Strategy Command & De Composite od • Complement one another Go Command Memento and mutually reinforce their * beneficial properties. Memento P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O • Create whole and balanced Concrete Composite Command Command designs that expose the required operational and developmental qualities. Application Pattern-Oriented Software Architecture 7 © Frank Buschmann, Kevlin Henney, all rights reserved On Designing with Patterns (5) This tutorial is on designing with The network patterns to create, Telegram Telegram with economy and elegance, Forwarder Receiver passes telegrams to passes telegrams to software designs and Telegram passes Converter commands to implementations applies Command Logging Logger Processor Strategy that work and meet their executes Log expected quality attributes! Command creates Alarms Pick SetPoint Workpiece Calculation P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Pattern-Oriented Software Architecture 8 © Frank Buschmann, Kevlin Henney, all rights reserved 4 Where we are Introduction Stand-Alone Patterns Pattern Complements / Pattern Compounds Pattern Stories / Pattern Sequences Pattern Languages P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Outroduction References Pattern-Oriented Software Architecture 9 © Frank Buschmann, Kevlin Henney, all rights reserved A Solution to a Problem (1) A stand-alone pattern: • Presents a solution for a recurring problem that arises in a specific context. • Documents proven design experience; is an "aggressive disregard of originality" Brian Foote • Specifies a spatial configuration of elements and the behavior that happens in this configuration. • Provides common vocabulary and conceptual understanding. P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Pattern-Oriented Software Architecture 10 © Frank Buschmann, Kevlin Henney, all rights reserved 5 Half-Object Plus Protocol at a Glance Problem Half Objects How can we design objects in a Node 1 Node 2 distributed system: local • such that access to them and the execution of their services incurs minimal performance penalties? remote Solution • Split an object into multiple halves – Client Protocol P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O one half per address space from which the object is accessed. • Within each half, fully implement all functionality that can be executed locally without using the network. • Implement functionality that crosses address spaces partially in each half and coordinate the halves via a protocol. Pattern-Oriented Software Architecture 11 © Frank Buschmann, Kevlin Henney, all rights reserved A Solution to a Problem (2) A stand-alone pattern: • Is both a process and a thing, with the thing being created by the process. • Addresses a set of forces that completes the general problem by describing requirements, constraints, and desired properties for the solution. • Introduces a set of interacting roles that can be arranged in many different ways, not a fixed configuration of classes or components. P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O • Specifies a solution that is based on experience, judgment, and diligence – it cannot necessarily be constructed in a straightforward manner using a common engineering method. Pattern-Oriented Software Architecture 12 © Frank Buschmann, Kevlin Henney, all rights reserved 6 Half-Object Plus Protocol at a Glance (2) Problem Role: Half Objects Force How can we design objects in a Node 1 Node 2 distributed system: local • such that access to them and the execution of their services incurs minimal performance penalties? remote Solution Role: Client Role: Protocol • Split an object into multiple halves – P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O one half per address space from which the object is accessed. Process- oriented • Within each half, implement all functionality that solution can be executed locally without using the network. • Implement functionality that crosses address spaces partially in each half and coordinate the halves via a protocol. Pattern-Oriented Software Architecture 13 © Frank Buschmann, Kevlin Henney, all rights reserved Designing with Stand-Alone Patterns Stand-alone patterns can help you to resolve specific, restricted problems well, but • They discuss the solution they introduce in isolation from other problems and their solutions, and also the dependencies between the problems and solutions. • They do not consider alternative solutions to similar problems but with different sets of forces. • They do not inform you when to address the problem in the context of designing a concrete system that must resolve many different problems. P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Patterns are like colorful words, bits and pieces of an expressive language whose grammar is forgotten and whose exciting stories and cultural tales are lost! Pattern-Oriented Software Architecture 14 © Frank Buschmann, Kevlin Henney, all rights reserved 7 Where we are Introduction Stand-Alone Patterns Pattern Complements / Pattern Compounds Pattern Stories / Pattern Sequences Pattern Languages P A T E R N –P A RE C H I T E U R R E A W A E D S O F T R I E N T O Outroduction References Pattern-Oriented Software Architecture 15 © Frank Buschmann, Kevlin Henney, all rights reserved Pattern Complements Pattern complements are sets of patterns that are • Complementary with respect to competition.