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

CSC308 Lecture 11

CSC308 Lecture 11

Software Engineering I
UML Class Diagram II
(202302)

Javier Gonzalez-Sanchez
PRO

October 14, 2022
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSC 308
    Software Engineering 1
    Lecture 11:
    UML Class Diagram II
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  2. jgs
    Previously …

    View Slide

  3. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 3
    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() {
    c1 = new C();
    }
    public void method() {
    B b = new B();
    b.sleep();
    }
    }
    public class Y {
    A [] a = new A[5];
    }
    Lab

    View Slide

  4. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 4
    Thoughts?

    View Slide

  5. jgs
    Design Principles

    View Slide

  6. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 6
    Association or Dependency
    VS
    Aggregation or Composition
    Separation of Concerns

    View Slide

  7. jgs
    Test Yourselves

    View Slide

  8. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 8
    Step 2

    View Slide

  9. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 9
    Class Diagram

    View Slide

  10. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 10
    Class Diagram

    View Slide

  11. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 11
    Variables

    View Slide

  12. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 12
    paintComponent

    View Slide

  13. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 13
    Auxiliar Method

    View Slide

  14. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 14
    Mouse

    View Slide

  15. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 15
    Questions

    View Slide

  16. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 16
    Office Hours
    Tuesday and Thursday 3 - 5 pm
    But an appointment required
    Sent me an email – [email protected]

    View Slide

  17. jgs

    View Slide

  18. jgs
    CSC 308
    Software Engineering 1
    Lab 11:
    UML Class Diagram
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  19. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 19
    § A classroom has 1 professor, 1 whiteboard, 30 students, and a number of
    markers.
    § The classroom “gives” the markers to the professor, and the professor uses
    them.
    § The classroom provides students with access to the Professor and the
    Professor with access to the students. There is a “dependency” between
    professors and students and between students and professors.
    § Students and Professors are People. People are able to introduce
    themselves.
    § Professors sign a contract to teach. Students sign contract to study.
    Create a Class Diagram

    View Slide

  20. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 20
    Ideas

    View Slide

  21. jgs
    CSC 308 Software Engineering I
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Winter 2023
    Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly.
    They cannot be distributed or used for another purpose.

    View Slide