In the previous chapter, about data binding, we introduced the observer pattern. Data binding is a rather specific use of the observer pattern, where changes to the data made by one observer are notified to other observers so that they are able to update their views. Here, we are looking at a more generic implementation of this pattern.
Observer is a design pattern associated with broadcasting changes in state of a single object (commonly referred to as the broadcaster) to one or more observers. In a web application, the state of an object can be defined by the values of its attributes. Indeed, for a Backbase application, the pattern determines how changes to any of the attributes of a broadcasting element are propagated to observing elements.
Any element can be used as a broadcaster in a Backbase application or it can be a special BTL element named broadcaster
.
For an element to be an observer, it should have its XEL observes
global attribute set to a valid id
of the...