Design Patterns Java™ Workbook
Chapter 7. Introducing Responsibility One feature that makes a class easier to use is that its method names suggest, accurately, ...
Chapter 7. Introducing Responsibility Figure 7.2. Protected visibility lets classes outside your package access your code in way ...
Chapter 7. Introducing Responsibility CHALLENGE 7.4 In this situation, how could you prevent other developers from taking advant ...
Chapter 7. Introducing Responsibility The intent of each design pattern is to solve a problem in a context. Responsibility-orien ...
Chapter 8. Singleton............................................................................................................ ...
Chapter 8. Singleton public static Factory getFactory() { if (factory == null) { factory = new Factory(); // ... } return factor ...
Chapter 8. Singleton public static Factory_2 getFactory() { synchronized (classLock) { if (factory == null) { factory = new Fact ...
Chapter 8. Singleton Figure 8.1. Which classes appear to apply Singleton? CHALLENGE 8.4 For each class in Figure 8.1, say whethe ...
Chapter 9. Observer Chapter 9. Observer Clients ordinarily gather information from an interesting object by calling its methods. ...
Chapter 9. Observer Suppose that the burn rate and thrust equations are: The application in Figure 9.1 shows how tpeak affects t ...
Chapter 9. Observer CHALLENGE 9.1 Complete the slider() and stateChanged() methods for ShowBallistics_1 so that the ballistics p ...
Chapter 9. Observer public BallisticsPanel_2( BallisticsFunction func, JSlider slider) { this.func = func; this.slider = slider; ...
Chapter 9. Observer Layering usually includes a clear definition of the interfaces between layers, such as a GUI and the busines ...
Chapter 9. Observer The notifyObservers() methods calls the update() method of each registered observer. The update() method is ...
Chapter 9. Observer CHALLENGE 9.4 Suppose that tPeak is an instance of Tpeak and an attribute of the ShowBallistics class. Compl ...
Chapter 9. Observer CHALLENGE 9.5 Fill in the messages in Figure 9.5. Figure 9.5. MVC causes calls to pass from a GUI layer into ...
Chapter 9. Observer class forward key method calls to it. The Component class in java.awt uses this approach, although it uses a ...
Chapter 9. Observer CHALLENGE 9.6 Complete the class diagram in Figure 9.7 to show Tpeak using a PropertyChangeSupport object to ...
Chapter 9. Observer When you decide to apply OBSERVER, you can write the registration and listening mechanisms yourself, but Jav ...
Chapter 10. Mediator............................................................................................................ ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf