Why interface is used in observer pattern?

I have read in the book that the application layer is supposed to be independent of the presentation layer. Design pattern are solution to problem like that. Observer pattern is applicable when an object should be able to notify other objects without making assumptions about who those objects are.But a method such as addObserver adds the observers to the list of observers. After that, observerable know which objects are to be notified. And how those list are used? In the book I read, it said that the observerable only access observer through the interface defined in the application layer so that the layer architecture of the system is preserved. Then the interface use that list? lf so, what is the difference?


Category: design patterns Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.174 (s). 12 q(s)