






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The observer pattern is a software design technique that enables a one-to-many dependency between objects, allowing the subject to notify its dependents (observers) automatically when its state changes. The intent, problem, solution, and implementation of the observer pattern, along with an example using java.
Typology: Study notes
1 / 11
This page cannot be seen from the preview
Don't miss anything!







interface interface
MyObserverMyObserver
void
update
(Custom
void
update
(Custom
myCust myCust);
class class
AddrVerificationAddrVerification
implement implement
MyObserverMyObserver
publicpublic
AddrVerificationAddrVerification()
Public
void
update
(Customer
Public
void
update
(Customer
myCust myCust)
//do//do
AdddressAdddress
Verification
stuff
here
Verification
stuff
here
class class
WelcomeLetterWelcomeLetter
implements implements
MyObserver MyObserver
publicpublic
WelcomeLetterWelcomeLetter
public
void
update
(Customer
public
void
update
(Customer
myCustmyCust)
do
Welcome
Letter
Stuff
here
do
Welcome
Letter
Stuff
here