$30 off During Our Annual Pro Sale. View Details »

CSE564 Lecture 20

CSE564 Lecture 20

Software Design
Connecting the Dots II
(202111)

Javier Gonzalez-Sanchez
PRO

September 20, 2020
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSE 564 Software Design Lecture 20: Connecting the Dots

    II Dr. Javier Gonzalez-Sanchez javiergs@asu.edu javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. jgs 564 00010100 Announcement § Quiz 5 is open and

    due November 16 (before our lecture time) 30 minutes Individual. § Assignment 4 is open and due November 18 (before our lecture time) Programming assignment It is a team project. I create the teams. No, you cannot change your team Report to us if someone is not working or able to be contacted
  3. jgs Assignment 4

  4. jgs 564 00010100 You have this

  5. jgs 564 00010100 Step 1. Menu File Connections Action New

    Load Save TSP – nearest neighbor Clusters User connect TSP - pro Move ⬁ Connect ↘ * Double click a city to edit Create ✩
  6. jgs 564 00010100 Step 2. Actions D B A C

    Move ⬁ Connect ↘ Create ✩ File Connections Action Factory Factory Iterator Iterator
  7. jgs 564 00010100 Step 3. Connections D B A C

    File Connections Action TSP – nearest neighbor Clusters User connect TSP - pro
  8. jgs 564 00010100 Step 3. Connections § TSP – pro

    The most direct solution would be to try all permutations (ordered combinations) and see which one is cheapest (using brute-force search). The running time for this approach lies within a polynomial factor of O (n!), the factorial of the number of cities, so this solution becomes impractical even for only 20 cities. https://en.wikipedia.org/wiki/Travelling_salesman_problem § Keep the GUI drawing lines. § Use multithreading
  9. jgs 564 00010100 Step 3. Connections D B A C

    File Connections Action TSP – nearest neighbor Clusters User connect TSP - pro Handler Iterator
  10. jgs 564 00010100 Step 4. File D B A C

    File Connections Action
  11. jgs 564 00010100 Step 5. Customize Cities File Connections Action

    D B A C • Shape • Color • Size * Double click a city to edit We are going to have problems detecting “selection” (contains)
  12. jgs 564 00010100 Status Bar | Keep the User on

    the Loop messages, what is happening? Logger
  13. jgs 564 00010100 Manufacturing vs Crafting 1 2 3 5

    4
  14. jgs 564 00010100 Key Ideas Manufacturing VS. Craftmanship Take advantage

    of § SOLID principles § Design Patterns § Low Coupling § High Cohesion Grades are individual, then a) How to stablish a limit to my responsibilities and the others? b) How to facilitate integration? c) Component Oriented Approach
  15. jgs Previously …

  16. jgs 564 00010100 Warning! hypothetical scenario ahead, just for fun

  17. jgs 564 00010100 Idea 2 Main Factory Gift Ball Box

    Envelop Handler Supervisor Bin GUI
  18. jgs Draft 1

  19. jgs 564 00010100 Idea (and this is NOT a class

    diagram) wrapper2 Main wrapper1 Factory decoration Envelope Box Gift wrapper3 ball Supervisor Is big > 10, box Is small < 5, envelop Is not big and It is not small, no decoration
  20. jgs 564 00010100 Main

  21. jgs 564 00010100 Factory

  22. jgs 564 00010100 Chain of Responsibilities

  23. jgs 564 00010100 Decorator

  24. jgs 564 00010100 Decorator

  25. jgs 564 00010100 Observer

  26. jgs Draft 2

  27. jgs 564 00010100 Idea 1 Main Factory Gift Ball Box

    Envelop Handler Supervisor Bin
  28. jgs 564 00010100 Idea 1 In main: In ConcreteHandlerWithBox: In

    ConcreteHandlerWithEnvelop:
  29. jgs Draft 3

  30. jgs 564 00010100 Idea 2 Main Factory Gift Ball Box

    Envelop Handler Supervisor Bin GUI
  31. jgs 564 00010100 Idea 2

  32. jgs 564 00010100 Idea 2 :: the GUI elements

  33. jgs 564 00010100 Idea 2 :: Listener

  34. jgs 564 00010100 Questions

  35. jgs CSE 564 Software Design Javier Gonzalez-Sanchez, Ph.D. javiergs@asu.edu Fall

    2021 Copyright. These slides can only be used as study material for the class CSE564 at ASU. They cannot be distributed or used for another purpose.