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

CSC307 Lecture 10

CSC307 Lecture 10

Introduction to Software Engineering
Patterns II
(202407)

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 10. Patterns II
  2. Decorator vs Inheritance • Both a llow you to ch

    a nge how a n object beh a ves. • The decor a tor p a ttern a llows you to extend (decor a te) the function a lity of a n object a t runtime. • Inherit a nce a dds beh a vior a t compil a tion time. 14
  3. Main 25 dr a w dr a w dr a

    w https://github.com/CSC3100/Patterns
  4. Decorator vs Inheritance • Both a llow you to ch

    a nge how a n object beh a ves. • The decor a tor p a ttern a llows you to extend (decor a te) the function a lity of a n object a t runtime. • Inherit a nce a dds beh a vior a t compil a tion time. 27
  5. Application | Observer 33 Main JFrame ChartPanel Thread <<Singleton>> Board

    Genius JPanel PropertyChange Listener PropertyChange Support
  6. CSC 307 Introduction to Software Engineering Javier Gonzalez-Sanchez, Ph.D. [email protected]

    Spring 2025 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.