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

CSC307 Lecture 08

CSC307 Lecture 08

Introduction to Software Engineering
Software Design
(202307)

Javier Gonzalez-Sanchez
PRO

July 03, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSC 307
    Introduction to Software Engineering
    Lecture 08:
    Software Design
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  2. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 3
    Assignment 01

    View Slide

  3. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 4
    Assignment 01
    https://blockly-spiderworld.sourceforge.io/appengine/spider.html

    View Slide

  4. jgs
    Test Yourselves
    Class Diagrams

    View Slide

  5. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 6
    Can you do this?

    View Slide

  6. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 7
    What do you think about this?

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  11. jgs
    Previously …

    View Slide

  12. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 13
    § Modeling or Design
    § Construction or Coding
    Activities

    View Slide

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

    View Slide

  14. jgs
    Let’s Do This
    Events and Listeners

    View Slide

  15. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 16
    Release 1. GUI

    View Slide

  16. View Slide

  17. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 18
    Release 2. Action Listeners

    View Slide

  18. View Slide

  19. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 20
    Release 3. Draw Area

    View Slide

  20. View Slide

  21. View Slide

  22. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 23
    Release 4. Mouse Listeners

    View Slide

  23. View Slide

  24. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 25
    § public void mousePressed (MouseEvent e) {}
    § public void mouseClicked(MouseEvent e) { }
    § public void mouseReleased(MouseEvent e) { }
    § public void mouseEntered(MouseEvent e) { }
    § public void mouseExited(MouseEvent e) { }
    § public void mouseDragged(MouseEvent me) { }
    § public void mouseMoved(MouseEvent e) { }
    MouseListener

    View Slide

  25. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 26
    § public void mouseDragged(MouseEvent me) { }
    § public void mouseMoved(MouseEvent e) { }
    MouseMotionListener

    View Slide

  26. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 27
    Release 5. Draw + Mouse

    View Slide

  27. View Slide

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

    View Slide

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

    View Slide

  30. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 31
    § https://github.com/javiergs/GAME/blob/main/paint/src/DrawArea.java

    View Slide

  31. jgs

    View Slide

  32. jgs
    CSC 307
    Introduction to Software Engineering
    Lab 07:
    Pair Programming
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  33. jgs
    Pair Programming
    Reference:
    On Pair Programming by Martin Fowler (Agile, Architecture, Refactoring)
    https://martinfowler.com/articles/on-pair-programming.html

    View Slide

  34. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 35
    § Best programs and designs are done in pairs because you can
    criticize each other, find each other’s errors, and use the best ideas.
    - Jean Bartik (one of the very first programmers)
    § Write all production programs with two people sitting at one machine.
    - Kent Beck (Agile, JUnit)
    Pair Programming

    View Slide

  35. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 36
    § The process starts with the developers receiving a well-defined task.
    § They agree on one small goal at a time.
    § They take turns to code or review each other's work.
    § Rotating roles regularly helps keep both developers alert and engaged.
    § Enable senior developers to share their knowledge and working habits
    § Help new team members get up to speed on a project.
    Process

    View Slide

  36. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 37
    § Driver (the person on the keyboard). Focused on completing the tiny goal at
    hand, ignoring larger issues for the moment. A driver should always talk
    through what they are doing while doing it.
    § Navigator (the person observing). They review the code on the go, gives
    directions, and shares thoughts. They have an eye on the larger issues, and
    bugs, and make notes of potential next steps or obstacles. They are in
    control of the strategic or architectural elements. As a navigator, leave the
    details of the coding to the driver – your job is to take a step back and
    complement the driver’s tactical mode with medium-term thinking.
    Roles

    View Slide

  37. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 38
    • Equally engaging pairs. If both developers do not equally engage in the
    project, then there is less chance that knowledge will be shared
    • Social and interactive process. It is hard for those who work better alone.
    Problem

    View Slide

  38. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 39
    Think about this
    1. Select your pair
    2. Understand the task
    (described before)
    3. Chose and set up your
    environment
    4. Be ready to work

    View Slide

  39. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 40
    App

    View Slide

  40. jgs
    Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 | 41
    Let’s Work

    View Slide

  41. jgs
    CSC 307 Introduction to Software Engineering
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Summer 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