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

CSC509 Lecture 13

CSC509 Lecture 13

Software Design
Final Review
(202312)

Javier Gonzalez-Sanchez

December 03, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSC 509 Software Engineering II: Modeling and Design Lecture

    13: Final Review Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227
  2. jgs The following slides shows some examples related to some

    topics This is NOT a comprehensive list of topics
  3. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    3 Grading Team Project 30% 30% Assignments, Quizzes, Labs 25% Final Exam 10% Attendance & Participation 5% Self / Peer Evaluation 100%
  4. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    4 Grading 100% A >= 96.5 A- >= 93.0 B+ >= 89.5 B >= 86.0 B- >= 82.5 C+ >= 79 C >= 75.5 C- >= 72.0 D+ >= 68.5 D >= 65.0 D- >= 61.5 F < 61.5
  5. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    5 Alternative Solution New Yorker, June 1992 "Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves". – Alan Kay. Pioneering work on object-oriented programming ACM Queue. Vol. 2, No. 9 - Dec/Jan 2004-2005
  6. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    7 Object Oriented Relationships Association Directed Association Reflexive Association Multiplicity Aggregation Composition Generalization Realization
  7. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    8 Relationships Association Directed Association Reflexive Association Multiplicity Aggregation Composition Generalization Realization
  8. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    9 public class A extends B { C c1, c2; public A() { c1 = new C(); } public void method() { D d = new D(); d.working(); } } public class X { public void m() { B var = new A(); double x = Math.sqrt(5); } } public class B implements E { public B() { C c1 = new C(); } public void method() { B b = new B(); b.sleep(); } } public class Y { A [] a = new A[5]; } Lab
  9. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    11 § Keep it Simple - over-designing the system is as bad as their absence when needed. § A design that is more than what we need smells. § Design principles are not a perfume to be liberally scattered all over the system. Key idea
  10. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    14 Design (Part 3) C D 👉 👉 👉 👉 🤔 😩 😩 😩 😩 👉
  11. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    15 § DRY § KIS Java Programming
  12. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    16 There are five key design principles to consider in Object-Oriented: § Single Responsibility Principle (SRP) § Open-Closed Principle (OCP) § Liskov Substitution Principle (LSP) a child should always be better than its parent. § Interface Segregation Principle (ISP) broke up interfaces § Dependency Inversion Principle (DIP) do not call us, we will call you Design Principles
  13. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    20 • Instability = Cout (Cin + Cout) Stable Abstraction Principle (SAP)
  14. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    22 Example ITeamA = 6 / 0 + 6 = 1 ATeamA = 0 DTeamA = 0 + 1 – 1 = 0
  15. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    23 Structural Metrics Instability = Cout (Cin + Cout) D = A + I – 1
  16. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    30 Idea 2 Main Factory Gift Ball Box Envelop Handler Supervisor Bin GUI
  17. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    31 § Library § Framework § Platform § API Concepts
  18. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    33 § These are singletons, to access the instances use § XXXPackage.eINSTANCE § XXXFactory.eINSTANCE § Use the Factory to create instances of your model classes, e.g: TaskList t = ExampleFactory.eINSTANCE.createTaskList(); § Use the Package to access the meta-model definition, e.g: EClass c = ExamplePackage.eINSTANCE.getTaskList(); List attrs = c.getEAttributes(); Patterns
  19. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    34 package myModel.impl; public class StudentImpl extends MinimalEObjectImpl.Container implements Student { protected boolean hasScholarship = HAS_SCHOLARSHIP_EDEFAULT; protected Computer computer; @Override public void setComputer(Computer newComputer) { Computer oldComputer = computer; computer = newComputer; if (eNotificationRequired()) eNotify(new ENotificationImpl (this, Notification.SET, MyModelPackage.STUDENT__COMPUTER, oldComputer, computer)); } @Override public Computer getComputer() { if (computer != null && computer.eIsProxy()) { InternalEObject oldComputer = (InternalEObject)computer; computer = (Computer)eResolveProxy(oldComputer); if (computer != oldComputer) { if (eNotificationRequired()) eNotify(new ENotificationImpl (this, Notification.RESOLVE, MyModelPackage.STUDENT__COMPUTER, oldComputer, computer)); } } return computer; } } Patterns
  20. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    35 Jakarta Platform request.getQueryString()
  21. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    36 Guidelines Can you create the “blueprint” for that one?
  22. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    38 Guidelines Can you create the “blueprint” for that one?
  23. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    39 Servlet Container Server Apache Java Servlet JRE JVM Java Libraries Your program HTTP @WebServlet (”/name")
  24. jgs CSE 564 Computer Systems Fundamentals Javier Gonzalez-Sanchez [email protected] Fall

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