1 / 11

Questions First

Questions First. On class? On project? On material we’ve discussed? Other?. CSE403 Section 3:. Best Practices for Software System Design (continued).

yvon
Download Presentation

Questions First

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Questions First • On class? • On project? • On material we’ve discussed? • Other?

  2. CSE403Section 3: Best Practices for Software System Design (continued) "There are two ways of constructing a software design: one way is to make it so simple that there are obviously no deficiencies; the other is to make it so complicated that there are no obvious deficiencies.“ C.A.R. Hoare (1985) Valentin Razmov, CSE403, Sp'05

  3. Design in a Nutshell • “Treat design as a wicked, sloppy, heuristic process. Don’t settle for the first design that occurs to you. Collaborate. Strive for simplicity. Prototype when you need to. Iterate, iterate, and iterate again. You’ll be happy with your designs.” Steve McConnell, Code Complete, 2nd ed., chap 5, http://www.cc2e.com/docs/Chapter5-Design.pdf

  4. Why Learn How to Design?

  5. Best Practices for Software Design • Favor composition over inheritance. • Example:

  6. Principles for Good Design(from Robert Martin’s “Agile Software Development – Principles…“) • Open-Closed Principle • “Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.” • Example: An abstract class to extend (with as many new subclasses as needed) rather than modifying an existing class to accommodate each new addition. • The designer chooses what changes to anticipate.

  7. Principles for Good Design (cont.) • Dependency Inversion Principle • (A) “High-level modules should not depend on low-level modules. Both should depend on abstractions.” • (B) “Abstractions should not depend on details. Details should depend on abstractions.” • Example: Separation of policy and mechanism

  8. Principles for Good Design (cont.) • Single Responsibility Principle • “A class should have only one reason to change.” • Example 1: Putting state in a GUI class. • Can be avoided using the Model-View-Controller pattern. • Example 2: interface Modem { public void dial (String pno); public void hangup(); public void send (char c); public char recv(); }

  9. Principles for Good Design (cont.) • Interface Segregation Principle • “Clients should not be forced to depend on methods that they do not use.” • Example: Dogs jump but don’t sing.

  10. Examples of Bad Designs Practices • “Design by committee” • Everyone on the committee puts in their favorite features into the soup. What is the result? • Moral: The design must be owned and managed by someone. • Others you have heard of?

  11. One-minute Feedback • What one or two ideas discussed today captured your attention and thinking the most? • List any ideas / concepts that you would like to hear more about in this class. Be specific.

More Related