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

CSC305 Lecture 11

CSC305 Lecture 11

Individual Software Design and Development
Patterns
(202510)

Avatar for Javier Gonzalez-Sanchez

Javier Gonzalez-Sanchez PRO

October 15, 2025
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 305 Individual Software Design and Development Lecture 11. Patterns
  2. ✅ Dependencies + Architecture ✅ GUI + Multithreading ✅ Object-Oriented

    Programming Week 06 2 ✅ Clean Code ✅ Object-Oriented Design
  3. Running code isn’t enough — design matters This class is

    about design, not just programming.Being able to compile and run your code is necessary but not sufficient — the focus should be on demonstrating clear design, quality, and adherence to standards.
  4. GitHubViz 2.0 5 Size control is managed through the alpha

    value: with zero lines the display is fully transparent, and as the number of lines increases toward the maximum, the color becomes darker. Complexity is represented by color, determined by the total number of conditional or loop statements (if, switch, while, for). When this total exceeds ten, the color is red; when it is greater than five, the color is yellow; otherwise, it is green.
  5. De f inition • Design patterns a re solutions to

    softw a re design problems you f ind a g a in a nd a g a in in re a l-world a pplic a tion development. • P a tterns a re a bout reusable designs a nd inter a ctions between objects. • The 23 G a ng of Four (GoF) patterns a re gener a lly considered the found a tion for a ll other p a tterns (G a mm a , Helm, Johnson, a nd Vlissides). 8
  6. Singleton class MainApp { public static void Main(String []a){ Singleton

    s1 = Singleton.getInstance(); Singleton s2 = Singleton.getInstance(); // Test for same instance if (s1 == s2){ // true - Objects are the same instance } } } 12
  7. Singleton class Singleton{ private static Singleton _instance; private Singleton() {}

    public static Singleton getInstance(){ if (_instance == null){ _instance = new Singleton(); } return _instance; } } 13
  8. Important 25 Do not reinvent the wheel! (Do not make

    another implementation for classes Observer or Observable -they already exist in libraries!)
  9. Lab

  10. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Fall 2025 Copyright. These slides can only be used as study material for the class CSC305 at Cal Poly. They cannot be distributed or used for another purpose.