You are on page 1of 3

Software Design Lec06 Guide: Behavioural Design Patterns Page 1 of 3

Chapter6 Guide
A. Mapping of Iterator design patterns (DP) in the case of linked list iterators
Name in DP Actual Name
1. Aggregate List <interface>
ConcreteAggregate LinkedList
createIterator( ) listIterator()
2. Iterator ListIterator <interface>
ConcreteIterator An anonymous class that implements the ListIterator interface type
next() next()
isDone() opposite of hasNext()
currentItem() return value of next()

B. Exercise1: Please draw the Chain of Responsibility class diagram with improvement for
dependency & aggregation, plus inheritance with lowercase methods. [1m]

728057123.doc 2/18/2024 FCI, MMU Cyberjaya


Software Design Lec06 Guide: Behavioural Design Patterns Page 2 of 3

C. Interpreter DP – Structure mapped to the Computer and Components Example

D. Command DP – Structure mapped to the WordProcessor Example

E. Relationship between the names in Strategy DP and the Java layout management manifestation

728057123.doc 2/18/2024 FCI, MMU Cyberjaya


Software Design Lec06 Guide: Behavioural Design Patterns Page 3 of 3

F1. Exercise2: Write the table for mapping of the case of JButton & its event listeners to Observer
Design Pattern [2m].

Name in DP Actual Name Collaborations


1. Subject JButton [i] push model:
1a. attach( ) addActionListener() ConcreteSubject notifies its
1b. notify( ) actionPerformed( ) observers
2. Observer ActionListener <<interface>> [ii] pull model:
ConcreteObserver The class that implements the ConcreteObserver object
ActionListener interface type may query for information

F2. Observer DP – Structure mapped to the Source, Headquarters, SeniorManagement, and


MarketingDemand Example

Client
dependency

Have fun!

728057123.doc 2/18/2024 FCI, MMU Cyberjaya

You might also like