An inexperienced developer created the following object model. Adding new instruments turned out to be complicated with this design, because the space shuttle needs to know all the instruments. It updates their states by explicitly invoking the appropriate methods (e.g. updateXY() in GPS). Every new instrument requires changing the SpaceShuttle class. Improve this design using a design pattern. Draw a UML class diagram to explain your improved design.
Aucun commentaire:
Enregistrer un commentaire