AlexLecture_ModellingCollaborations

AlexLecture_ModellingCollaborations - Modeling &...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Review: Adapter Pattern Structure 1: Multiple Inheritance (Class Adapter) - A class adapter uses multiple inheritance to adapt one interface to another: Structure 2: Encapsulation (Object Adapter) - An object adapter relies on object composition: 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Review: Observer Pattern 3 Review: Avoid Changing Classes Adaptor Pattern Making two classes collaborate without changing any of the classes. Achieved by making an adaptor class that is inherited from two classes (hereby with two interfaces) Observer Pattern Adding new concrete observers and concrete subjects without changing existing concrete observers and concrete subjects. Adaptor Pattern vs. Observer Pattern Adaptor: from the interface perspective Client class works with adaptee through the adaptor class. Observer: from the even perspective 4 Observer: from the event Subjects generate events, observers listen to the events.
Background image of page 2
3 Review: Avoid Changing Classes Composite Pattern Adding new leaf/composite classes without changing existing composite classes Visitor Pattern Add new operations without changing existing classes (which often form a hierarchy that needs traversal) Abstract Factory Pattern Adding new part (i.e., data, objects) providers without changing an existing class that implements an algorithm operating on the parts Builder Pattern Adding new builders (e.g., textconverters) without changing the director class (e g the parser 5 (e.g., the parser) Concepts Collaboration: C ontextual relationship among instances that interact to implement a desired functionality pattern of message exchange among those instances to achieve some goal protocol Role: that subset of an object s characteristics needed to fulfill its responsibilities in a collaboration alternatively, a slot that can be filled by objects that wish to participate in the collaboration such objects are said to play the role Note that both definitions refer to instances Goals: 1 Design reusabl collaboration 6 1. Design reusable collaborations 2. Compose applications by synthesizing collaborations
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 How to describe collaboration Modern OO systems comprise lots of collaborations To understand such systems, requires visualizing: the inter-connection of these objects (i e structure) the inter connection of these objects (i.e., structure) the dynamic interactions among these objects (i.e., behavior)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

AlexLecture_ModellingCollaborations - Modeling &...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online