* a pragmatic, tried-and-tested approach to framework development
* how UML may be adapted to the specific needs of framework development
* real-world case study used to illustrate principles throughout the book, based on an e-commerce framework
* foreword by Grady Booch
* Object Technology series
The aim of the UML profile for framework architectures is the definition of a UML subset, enriched with a few UML-compliant extensions, which allows the annotation of such artefacts. Thus, the resulting profile that we call UML-F does not correspond to a specific domain, but to framework technology. Though profiles might be standardized in the future, sound proposals from various communities will get the process of defining and standardizing UML profiles started. In that sense, this book sets the stage for the UML profile for framework architectures.
Part I: The UML-F profile 1 Chapter 1: Why a UML profile for frameworks? 3 1.1 UML profiles 3 1.2 Object-oriented frameworksextensibility is the key 5 1.2.1 White-box components of frameworks 7 1.2.2 Black-box components of frameworks 8 1.3 Pros and cons of frameworks 9 1.3.1 UML-F as a means of supporting framework
development and adaptation 10 1.4 Goals for the UML-F profile 11 Chapter 2: UML essentials for framework documentation 13 2.1 UML overview 14 2.2 Class diagrams 15 2.3 Object diagrams 19 2.3.1 Object diagram example 19 2.3.2 Exemplar nature of object diagrams 21 2.4 Sequence diagrams 22 2.4.1 Sequence diagram example 23 2.4.2 Considerations about collaboration diagrams 24 2.5 Summary 26 Chapter 3: Basic elements of the UML-F profile 27 3.1 UML-F as a profile 28 3.1.1 Properties of the UML-F profile 28 3.2 UML-F tags standard UML tagged values and stereotypes unified 31 3.2.1 Stereotypes 31 3.2.2 Tagged values 33 3.2.3 UML-F tags for describing properties 34 3.3 Standard UML tags for framework documentation 35 3.4 UML-F presentation tags 38 3.4.1 Completeness and abstraction 38 3.4.2 Flat and hierarchical representation of classes
and expanded class views 41 3.4.3 UML-F extensions of the object diagram notation 44 3.4.4 Tags for sequence diagrams 45 3.5 UML-F framework tags 51 3.5.1 Framework and application classes 52 3.5.2 Overview of adaptation tags 53 3.5.3 Method adaptation tags 54 3.5.4 Tags in the context of classes and interfaces 57 3.5.5 Tags in the context of generalization 59 3.6 The UML-F mechanism for defining new tags 63 3.7 Summary 65 Chapter 4: UML-F tags for framework construction
principles and patterns 67 4.1 Unification principle adaptation by inheritance 68 4.1.1 UML-F template and hook tags 72 4.1.2 UML-F tags for the Unification construction principle 77 4.2 Separation principle adaptation through composition 79 4.2.1 Compositional adaptation with predefined black-box
components 80 4.2.2 Extending a set of black-box components at runtime 81 4.2.3 UML-F tags for the Separation construction principle 83 4.3 Terminology and concept excursion: abstract classes, abstract
coupling, Java interfaces 87 4.3.1 Abstract classes and abstract coupling 87 4.3.2 Java interfaces 88 4.4 Hooks as name designators of pattern catalog entries 91 4.4.1 GoF patterns with a templatehook unification 92 4.4.2 GoF patterns with a templatehook separation 93 4.4.3 GoF patterns with recursive templatehook combinations 94 4.5 UML-F tags for framework patterns 95 4.5.1 UML-F tags for the Factory Method pattern 97 4.5.2 UML-F tags for the Strategy pattern 99 4.5.3 UML-F tags for the Composite pattern 103 4.5.4 UML-F tags for a domain-specific pattern 107 4.5.5 UML-F tags for non-framework GoF patterns? 110 4.6 How essential framework construction principles scale 110 4.6.1 Finding a balance between template and hook methods 111 4.7 Summary 112 Chapter 5: Framework adaptations of UML-F pattern annotations 113 5.1 Cookbooks for framework adaptation 113 5.2 A sample cookbook recipe 116 5.3 Recipe for adapting the Unification construction principle 119 5.4 Recipe for adapting the Separation constuction principle 120 5.5 Recipe for adapting the Composite pattern 121 5.6 Automating the adaptation of UML-F pattern annotations 123 5.7 Summary 123 Part II: UML-F @ work 125 Chapter 6: UML-F based documentation and
adaptation of the JUnit testing framework 127 6.1 An overview of JUnit 127 6.1.1 Test cases 129 6.1.2 Test suites 130 6.1.3
The Unified Modeling Language (UML) community has started to define so-called profiles in order to better suit the needs of specific domains or settings. For example, a profile for embedded systems should refine notational elements that represent real-time constraints. Another one for electronic business might take the typical software architecture of such systems, and thus its principal domain-specific entities, into consideration to come up with a UML notation tailored for that purpose.
Object and component frameworks represent a special breed of object-oriented systems they are extensible semi-finished pieces of software. Completing the semi-finished software leads to different software pieces, typically specific applications, that share the same core. Though frameworks have been developed for a wide range of domains, they use common construction principles. For example, many of the design patterns written up by Gamma et al. (1995) rely on the framework construction principles.
The aim of the UML profile for framework architectures is the definition of a UML subset, enriched with a few UML-compliant extensions, which allows the annotation of such artefacts. Thus, the resulting profile that we call UML-F does not correspond to a specific domain, but to framework technology. Though profiles might be standardized in the future, sound proposals from various communities will get the process of defining and standardizing UML profiles started. In that sense, this book sets the stage for the UML profile for framework architectures.
The book is structured under two parts.
Part I: The UML-F profile
The first chapter promotes the UML-F profile as an essential means of describing framework architectures and summarizes framework-related terminology. The following chapters cover the UML subset on which UML-F is based, and the notational elements of UML-F that support framework modeling and annotation. This includes a mechanism to define sets of related tags for essential construction principles and design patterns.
Part II: UML-F@work
This part illustrates how UML-F is applied in the context of the sample framework JUnit. Considerations on the methodological implications of UML-F and a selection of practical hints and guidelines intended to assist in the design, development, and adaptation of frameworks complete this part.
The UML-F web site (http://www.UML-F.net) provides additional material, such as the source code of the examples discussed in the book, additional examples, research papers, and UML-F presentations.
Acknowledgments
Many people helped and advised us in the course of writing this book. Rebecca Wirfs-Brock carefully reviewed the manuscript. Her detailed hints and suggestions led to significant improvements. We would also like to thank Alan Wills and Mohamed Fayad for their helpful comments on an early version of the manuscript.
Timothy Brown, a computer science graduate from Washington University in St. Louis, not only corrected the English but also provided many useful ideas. Timothy Brown and Alessandro Pasetti co-authored Chapter 7. Several other colleagues helped us by reviewing parts of the manuscript and providing helpful feedback, including Lothar Schmitz, Heinrich Hussmann, Birgit Demuth, and Ljiljana Döhring. Thanks also go to the students of Wolfgang Prees software architecture course at the University of California, Berkeley in the Fall semester 2000.
We thank Carlos Lucena, Edward Hermann Haeusler, Sergio Carvalho, Julio Leite (all at Pontifícia Universidade CatólicaPUC, Rio de Janeiro); Donald Cowan, Paulo Alencar (at the University of Waterloo); and Marcos Borges at the Federal University of Rio de Janeiro. They made excellent comments on and contributions to a previous version of this work (Fontoura, 1999).
Special thanks go to Andrew Appel (Princeton University), and to Thomas K. Truong, Norm Pass, and Anant Jhingran (IBM Almaden Research Center, San Jose, CA) for their support regarding this work.
Finally, it was a pleasure to cooperate with the people from Addison-Wesley: Alison Birtwell, J. Carter Shanklin, Katherin Ekstrom, Claudia Orrell, and the copy editor Derek Atkins.
This work was partially funded by Nokia and the Bayerisches Staatsministerium für Wissenschaft, Forschung und Kunst under the Habilitation-Förderpreis Programm, by the Bayerische Forschungsstiftung under the FORSOFT research consortium, and the Bundesministerium für Bildung und Forschung (BMBF) under the Virtual Software Engineering Competence Center (ViSEK).
Traces of the books history
The book was initiated by Marus Fontoura when Wolfgang and Marcus met in Rio in July 1999. A month later Bernhard joined the team. Besides the truly distributed writing (Princeton, NJ; Constance, Germany; Munich, Germany; San Jose, CA; Berkeley, CA), the authors worked on the book during a sailing trip in the Caribbean in Spring 2000. The final proof-reading was accomplished on a lake near Salzburg in August 2001, exactly two years after Bernhard and Wolfgang met there for their initial discussions.
