Chain of Responsibility Pattern is a Behavioral Pattern in which, a Request is sent through a chain of handling Objects without knowing which Object will handle it. With Chain of Responsibility Pattern, we can avoid coupling the Sender of a request to received Objects and create a processing sequence automatically based on type of request.
Observer Pattern is a Behavioral Pattern in which, an Object (we call it Subject) contains a list of dependency Objects (we call them Observers). Observers will be notified and updated automatically whenever Subject changes its state. Today we’re gonna look at how Observer Pattern in Java works.