Solution description this involves two abstract

  • No School
  • AA 1
  • 7

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

Solution description This involves two abstract objects, Subject and Observer, and two concrete objects, Concrete Subject and Concrete Object, which inherit the attributes of the related abstract objects. The abstract objects include general operations that are applicable in all situations. The state to be displayed is maintained in Concrete Subject, which inherits operations from Subject allowing it to add and remove Observers (each observer corresponds to a display) and to issue a notification when the state has changed. The Concrete Observer maintains a copy of the state of Concrete Subject and implements the Update() interface of Observer that allows these copies to be kept in step. Consequences The subject only knows the abstract Observer and does not know details of the concrete class. Therefore there is minimal coupling between these objects. 25 7.2 Multiple displays using the Observer pattern (continued) 26 Chapter 7 Design and implementation 7.2 A UML model of the Observer pattern (continued) 27 Chapter 7 Design and implementation 7.2 Design problems (continued) To use patterns in your design, you need to recognize that any design problem you are facing may have an associated pattern that can be applied. Tell several objects that the state of some other object has changed (Observer pattern). Tidy up the interfaces to a number of related objects that have often been developed incrementally (Façade pattern). Provide a standard way of accessing the elements in a collection, irrespective of how that collection is implemented (Iterator pattern). Allow for the possibility of extending the functionality of an existing class at run-time (Decorator pattern). 28 Chapter 7 Design and implementation 7.3 Implementation issues Focus here is not on programming, although this is obviously important, but on other implementation issues that are often not covered in programming texts: Reuse Most modern software is constructed by reusing existing components or systems. When you are developing software, you should make as much use as possible of existing code. Configuration management During the development process, you have to keep track of the many different versions of each software component in a configuration management system. Host-target development Production software does not usually execute on the same computer as the software development environment. Rather, you develop it on one computer (the host system) and execute it on a separate computer (the target system). 29 Chapter 7 Design and implementation 7.3.1 Reuse From the 1960s to the 1990s, most new software was developed from scratch , by writing all code in a high- level programming language. The only significant reuse or software was the reuse of functions and objects in programming language libraries.
Image of page 5

Subscribe to view the full document.

Image of page 6
  • Fall '19
  • Design pattern, Free software

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes