1 / 27

WARNING

WARNING. These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010. They may not show up well on other PowerPoint versions . You can download PowerPoint 2010 viewer from here .

dagan
Download Presentation

WARNING

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. WARNING • These slides are not optimized for printing or exam preparation. These are for lecture delivery only. • These slides are made for PowerPoint 2010. They may not show up well on other PowerPoint versions. You can download PowerPoint 2010 viewer from here. • These slides contain a lot of animations. For optimal results, watch in slideshow mode.

  2. Which is the better Minesweeper design? (a) (b) Logic Minefield Storage Logic Minefield Storage :Logic m:Minefield :Storage :Logic m:Minefield :Storage mark mark mark mark update(m) update(m) get info get info design {a|b} e.g. design b 77577

  3. To Tighten or Loosen: What Makes a Good Component. CS2103/T, Lecture 7, Part 1, [Oct 4, 2013]

  4. To Tighten or Loosen: What Makes a Good Component.

  5. To Tighten or Loosen: • What Makes a Good Component. • Coupling • Cohesion

  6. Coupling

  7. Coupling

  8. Coupling

  9. Dependency == Component A Component B If I change B , will it require a change in A ? NO WAY It might • Coupling

  10. Component A Component B If I change B , will it require a change in A ? • Coupling

  11. Component A Component B If I change B , will it require a change in A ? • Coupling

  12. Component A Component B • Coupling

  13. Component A Component B If I change B, will it require a change in A?Yes, It might • Reduce coupling

  14. Good Component design • Reduce coupling cohesion

  15. cohesion

  16. Does one thing and does it all Component C Component A Component B cohesion

  17. Does one thing and does it all Window 1 Component A Window 2 Window 3 cohesion

  18. Does one thing and does it all Component C Component A Component B cohesion

  19. Does one thing and does it all Component C Component A Component B • Increase cohesion cohesion

  20. Good Component design • Increase cohesion • Reduce coupling

  21. Increase cohesion • Reduce coupling

  22. Use these two concepts to justify design decisions.

  23. (a) (b) Logic Minefield Storage Logic Minefield Storage

  24. (2nd attempt) Which is the better design? (a) (b) Logic Minefield Storage Logic Minefield Storage design2{a|b} e.g. design2 b 77577

More Related