09-gooddesignflexiblesoftwa

09-gooddesignflexiblesoftwa - Good Design = Flexible...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Good Design == Flexible Software Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 — Lecture 9 — 09/22/2009 1
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Lecture Goals • Review material from Chapter 5 Part 1 of the OO A&D textbook • Good Design == Flexible Software • The problem of “It seemed like a good idea at the time” • Discuss the Chapter 5 Example: Rick’s Guitars, Revisited • Emphasize the OO concepts and techniques encountered in Chapter 5 2
Image of page 2
Quiz • If you need to indicate that a search algorithm of some type will be used to traverse an association between two classes, what notation do you use and what is it called? • A sequence diagram shows interactions between what? • What are the dashed lines of a sequence diagram called? • What do the rectangles that appear above the dashed lines indicate? 3
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Quiz • If you need to indicate that a search algorithm of some type will be used to traverse an association between two classes, what notation do you use and what is it called? • A rectangle with a list of attributes attached to the class and association; qualification • A sequence diagram shows interactions between what? • objects (not classes) • What are the dashed lines of a sequence diagram called? • lifelines • What do the rectangles that appear above the dashed lines indicate? • flow of control; It indicates the object is actively doing something 4
Image of page 4
Chapter 5 Overview • Main Points • Change in software development is inevitable • In order to handle change, you need flexible software • In particular, you need to design your system to be flexible for the most common types of change that it will encounter • Designing flexibility for infrequent change is counterproductive • Unfortunately, achieving flexible designs “the first time” is really hard • And, typically, only possible after acquiring experience with a domain • Without experience, small changes can turn into big problems! 5
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Rick is Back • The software application that we produced for Rick back in Chapter 1 has been working great… • BUT… Rick would like to start carrying mandolins alongside guitars • Lets look at the original design and talk about how to add support for Mandolins 6
Image of page 6
Original Design (circa End of Chapter 1) addGuitar(String, double, GuitarSpec) getGuitar(Sring): Guitar search(GuitarSpec): Guitar [*] Inventory getSerialNumber(): String getPrice(): double setPrice(double) getSpec(): GuitarSpec serialNumber: String price: double Guitar getBuilder(): Builder getModel(): String getType(): Type getBackWood(): Wood getTopWood(): Wood getNumStrings(): int model: String numStrings: int GuitarSpec Builder Type Wood inventory * spec builder topWood backWood type 7
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
How to add a Mandolin? getSerialNumber(): String getPrice(): double setPrice(double) getSpec(): GuitarSpec serialNumber: String price: double Guitar getSerialNumber(): String getPrice(): double setPrice(double) getSpec(): MandolinSpec serialNumber: String price: double Mandolin These classes are very similar. What should we do?
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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