Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

CSC305 Lecture 15

CSC305 Lecture 15

Individual Software Design and Development
Decorator/Composite
(202410)

Javier Gonzalez-Sanchez

October 24, 2024
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 15. Decorator Pattern
  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. 13
  3. Application | Observer 18 Main JFrame ChartPanel Thread <<Singleton>> Board

    Genius JPanel PropertyChange Listener PropertyChange Support
  4. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Summer 2024 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.