Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SER516 Lecture 17

SER516 Lecture 17

Software Agility: Project and Process Management
Clean Design II
(202003)

B546a9b97d993392e4b22b74b99b91fe?s=128

Javier Gonzalez

February 21, 2019
Tweet

Transcript

  1. SER516 Software Agility: Project and Process Management Lecture 17. Clean

    Design II Javier Gonzalez-Sanchez javiergs@asu.edu javiergs.engineering.asu.edu Office Hours: By appointment
  2. About Your Velocity …

  3. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 3 Numbers

    for Project 2 Team Hours Points 1 40 55 2 20 18 3 75 26 4 5 10 20 6 50 60 7 48 45 8 44 52 • 5 members per team working 10 hours per week each • 50 person-hours per week
  4. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 4 Numbers

    for Project 3 Team Hours Points 1 49 91 2 63 55 3 103 37 4 5 34.5 70 6 59 84 7 60 66 8 56 65 • 5 members per team working 10 hours per week each • 50 person-hours per week
  5. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 5 Estimated

    Numbers for Project 4 Team Hours Points 1 85 140 2 110 100 3 117 48 4 5 50 100 6 90 110 7 60 70 8 108 136 • 5 members per team working 10 hours per week each • 50 person-hours per week
  6. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 6 Numbers

    for Project 4 § Size P4 in Points § Size P4 in Hours (optional) § Sprints = Size P4 / Average Velocity P2 and P3
  7. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 7 Sprint

    Size Team Size P4 Average points per sprint Sprints Did you complete it? 1 140 73 1.91 2 100 36.5 2.7 3 48 31.5 1.52 4 5 100 45 2.22 6 110 72 1.52 7 70 55.5 1.26 8 136 58.62 2.32 • 5 members per team working 10 hours per week each • 50 person-hours per week
  8. Separation of Concerns (SoC)

  9. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 9 Design

    Principles § Concerns and Separation of concerns § Dependencies and Dependency Injection § Low Coupling
  10. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 10 Patterns

    § Observer (behavior) § Delegate (behavior) § Factory (creation)
  11. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 11 Factory

    class Creator { public Product create() { return new Product (); } } class Client { private Iproduct product; public Client(Creator factory){ product= factory.create (); } public void run() { // ... } } public static void Main() { Creator creator = new Creator(); Client client = new Client(creator); client.run(); }
  12. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 12 Factory

    § JSON string to JSON object § Gson and/or Guava library Gson g = new Gson(); MyClass example = g.fromJson(stringToParse, MyClass.class) § JSON-Simple library JSONParser parser = new JSONParser(); JSONObject json = (JSONObject) parser.parse(stringToParse); § Jackson library MyClass object = new ObjectMapper().readValue(jsonString, MyClass.class);
  13. Dependency Injection (DI)

  14. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 14 Dependency

    Injection (DI) § A Java class has a dependency on another class, if it uses an instance of this class. § A class should not configure its dependencies statically (new) but should be configured from the outside (using vs having). § hard dependency – a class creates an instance of another class via the new operator § dependency injection – passing of a dependency to a dependent object (as a parameter)
  15. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 15 Dependency

    Injection (DI) public class ClientFrame { ... public ClientFrame() { ... = new PlotPanel(); ... = new FacePanel(); ... = new ConsolePanel(); ... = new JButton(); ... = new JLabel(); } } public class ClientFrame { public ClientFrame(Jpanel a, Jpanel b) { } }
  16. Low Coupling

  17. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 17 Definition

    § Low coupling. Coupling refers to the degree to which the different classes depend on each other. All classes should be independent as far as possible. § Create Mock objects (dummy implementations that emulate real code). § Create Interfaces
  18. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 18 Separation

    of Main § Execution vs Construction § Design the system assuming that all objects are constructed and wired up
  19. Test Yourselves

  20. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 20 What

    about this? View Controller Model Client View Controller Model Server
  21. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 21 What

    do you have? Highest value: Lowest value: Average: Channels: Frequency (Hz): Client O X - 2 ▼ localhost:1516 start / stop Console: Highest value: Lowest value: Frequency (Hz): Server O X - 1024 0 5 localhost:1516 start / stop Console:
  22. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 22 Case

    1
  23. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 23 Case

    2
  24. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 24 Case

    3
  25. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 25 Case

    4
  26. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 26 Case

    5
  27. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 27 Case

    6 sensing device Java platform external native libraries AgentNet toolkit ar.sensing gui ar.perception DelegatePerception <<delegate>> ThreadDevice <<observable, runnable>> PublisherThread <<observer, publisher>> PlotSet <<observer>> ConsoleObserver <<observer>>
  28. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 28 Case

    7
  29. Test Yourselves

  30. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 30 What

    do you have? Highest value: Lowest value: Average: Channels: Frequency (Hz): Client O X - 2 ▼ localhost:1516 start / stop Console: Highest value: Lowest value: Frequency (Hz): Server O X - 1024 0 5 localhost:1516 start / stop Console:
  31. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 31 Level

    1
  32. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 32 Level

    1
  33. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 33 Level

    1
  34. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 34 Level

    1
  35. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 35 Level

    1
  36. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 36 Level

    1
  37. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 37 Level

    1
  38. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 38 Level

    2
  39. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 39 Level

    2
  40. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 40 Level

    2
  41. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 41 Level

    2
  42. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 42 Level

    3
  43. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 43 Level

    3
  44. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 44 Level

    3
  45. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 45 Level

    4
  46. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 46 Level

    4
  47. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 47 Level

    4
  48. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 48 Level

    4
  49. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 49 Level

    5
  50. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 50 Level

    5
  51. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 51 Level

    6
  52. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 52 Level

    6
  53. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 53 Level

    7
  54. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 54 Level

    8
  55. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 55 Level

    9
  56. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 56 Level

    10
  57. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 63 Reference

    § Clean Code, Chapter 11 and 12.
  58. SER516 – Software Agility Javier Gonzalez-Sanchez javiergs@asu.edu Spring 2018 Disclaimer.

    These slides can only be used as study material for the SER516 course at ASU. They cannot be distributed or used for another purpose.