714 state diagrams continued state diagrams are used

  • No School
  • AA 1
  • 7

This preview shows page 4 - 6 out of 7 pages.

7.1.4 State diagrams (continued) State diagrams are used to show how objects respond to different service requests and the state transitions triggered by these requests. State diagrams are useful high-level models of a system or an object s run-time behavior. You don t usually need a state diagram for all of the objects in the system. Many of the objects in a system are relatively simple and a state model adds unnecessary detail to the design. 21 Chapter 7 Design and implementation 7.1.5 Interface specification Object interfaces have to be specified so that the objects and other components can be designed in parallel. Designers should avoid designing the interface representation but should hide this in the object itself. Objects may have several interfaces which are viewpoints on the methods provided. The UML uses class diagrams for interface specification but Java may also be used. 22 Chapter 7 Design and implementation 7.2 Design patterns A design pattern is a way of reusing abstract knowledge about a problem and its solution. A pattern is a description of the problem and the essence of its solution. It should be sufficiently abstract to be reused in different settings. Pattern descriptions usually make use of object-oriented characteristics such as inheritance and polymorphism. 23 Chapter 7 Design and implementation 7.2 Pattern elements (continued) Name A meaningful pattern identifier. Problem description. Solution description. Not a concrete design but a template for a design solution that can be instantiated in different ways. Consequences The results and trade- offs of applying the pattern. 24 Chapter 7 Design and implementation An Observer pattern Name Observer. Description Separates the display of object state from the object itself. Problem description Used when multiple displays of state are needed. Solution description See slide with UML description. Consequences Optimisations to enhance display performance are impractical.
Image of page 4

Subscribe to view the full document.