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

CSC307 Lecture 09

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

CSC307 Lecture 09

Introduction to Software Engineering
Patterns
(202407)

Avatar for Javier Gonzalez-Sanchez

Javier Gonzalez-Sanchez PRO

February 03, 2026
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 307 Introduction to Software Engineering Lecture 09. Patterns
  2. 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). 5
  3. Singleton class Singleton{ private static Singleton _instance; // Constructor is

    'protected' protected Singleton() {} public static Singleton getInstance(){ if (_instance == null){ _instance = new Singleton(); } return _instance; } } 9 https://github.com/CSC3100/Patterns
  4. Warning 11 Do not Abuse of the Singleton You are

    transforming OOP into Structural Programming!! 🙈
  5. Important 24 Do not reinvent the wheel! (Do not make

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

  7. CSC 307 Introduction to Software Engineering Javier Gonzalez-Sanchez, Ph.D. [email protected]

    Winter 2026 Copyright. These slides can only be used as study material for the class CSC307 at Cal Poly. They cannot be distributed or used for another purpose.