COMP 3004 Lecture Notes - Lecture 14: Composite Pattern, Observer Pattern, Common Interface

51 views7 pages

Document Summary

May be responsible for creating its own instance: collaborations: all collaboration via instance operation, consequences, controlled access to instance, reduced name space, permits a variable number of instances, more flexible than class operation. Notifies observers whenever a change occurs that could leave some observer inconsistent: concrete observer: maintains reference to concrete subject. Stores a state that should be consistent with the one of its subject. Similarly, an observer cannot just die: employed by mvc & mvp, composite pattern. If you notice you are treating groups and individual of objects the same way: participants, component: base class, declares the interface for objects in the composition, implements default behavior for the interface common to all classes. If the recipient is a leaf, then the request is handled directly. Clients don"t have to be changed for new component classes. I(cid:374)te(cid:374)t: (cid:862)defi(cid:374)e a fa(cid:373)ily of algorith(cid:373)s, e(cid:374)(cid:272)apsulate ea(cid:272)h o(cid:374)e, a(cid:374)d (cid:373)ake the(cid:373) interchangeable.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents