Pattern Overview
The observer pattern defines an one-to-many dependency between a subject object and any number observer objects so that when the subject object changes state, all its observers are notified and updated accordingly.
The Observer Pattern is also known as Dependents and Publishe-Subscribe.
 SAX uses the Observer Pattern. But only one Observer allowed.
XMLReader plays the role of Subject [ Subject - XMLReader].
org.xml.sax.ContentHandler interface plays the role of Observer [ Observer - Contenthandler]
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/8585387/viewspace-220361/，如需转载，请注明出处，否则将追究法律责任。