Question: Write the required Java code to implement only the two classes SecurityCamera and HomeOwner using the observer pattern. Assume that the methods Attach , Detach
Write the required Java code to implement only the two classes SecurityCamera and HomeOwner using the observer pattern. Assume that the methods Attach, Detach, Notify and Update present inside the classes Subject and Observer are abstracts. The SecurityCamera notifies the HomeOwner each time a movement is detected.
Subject observers Observer +Attach(o : Observer) +Detach(o: Observer) +Notify() +Update() subject Security Camera -detectMovement: Boolean +GetUpdate(): Boolean +SetUpdate(state: Boolean) Home Owner -ownerName: String +Update() +SetSubject(s: Subject)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
