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

CSC307 Lecture 11

CSC307 Lecture 11

Introduction to Software Engineering
Design Patterns II
(202307)

Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSC 307 Introduction to Software Engineering Lecture 11: Design

    Patterns II Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227 Office Hours: By appointment
  2. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    11 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 } } } Singleton
  3. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    12 class Singleton{ private static Singleton _instance; private Singleton() {} public static Singleton getInstance(){ if (_instance == null){ _instance = new Singleton(); } return _instance; } } Singleton
  4. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    15 Project – User selects Cluster and clicks Run ✅
  5. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    16 Project – User selects Cluster and clicks Run ✅
  6. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    17 Project – User selects Line and clicks Run ✅
  7. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    18 Project – User selects Line and clicks Run ✅
  8. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    19 Project – User selects Line and clicks Run ✅ ✅
  9. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    20 Project – User selects Cluster and clicks Run ✅ ✅
  10. jgs Javier Gonzalez-Sanchez | CSC 308 | Winter 2023 |

    22 Office Hours Tuesday and Thursday 3 - 5 pm But an appointment required Sent me an email – [email protected]
  11. jgs

  12. jgs CSC 307 Introduction to Software Engineering Lab 11: Getting

    Started with Assignment 02 Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227 Office Hours: By appointment
  13. 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.