aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Could someone explain the listener pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Could someone explain the listener pattern" Watch "Could someone explain the listener pattern" New topic
Author

Could someone explain the listener pattern

landon manning
Ranch Hand

Joined: Nov 20, 2000
Posts: 47
A friend suggested that I use the listener pattern for a project that I'm working on. Could someone explain the the implementation of the listener patern.
Thanks in advance
Landon Manning
Glen Tanner
Ranch Hand

Joined: Apr 16, 1999
Posts: 147

Bill Venners wrote a good article a while back.
"The Event Generator Idiom" http://www.artima.com/designtechniques/eventgen.html
John Wetherbie
Rancher

Joined: Apr 05, 2000
Posts: 1441
This is also known as the Observer pattern or Publish-Subscribe. This is one of the patterns from the Design Patterns book.
John


The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
Glen Tanner
Ranch Hand

Joined: Apr 16, 1999
Posts: 147

True. The article describes how to make an object Observable, since the Observer-Observable pattern is generic.
Linda Rising
Author
Ranch Hand

Joined: Jan 21, 2001
Posts: 76
Originally posted by landon manning:
A friend suggested that I use the listener pattern for a project that I'm working on. Could someone explain the the implementation of the listener patern.
Thanks in advance
Landon Manning

Hi,
You might also check out:
http://www.web3d.org/WorkingGroups/vrml-eai/impl/migration.html
and tell me if it helped and maybe you can win the book of the week :-)!
Linda

------------------
Linda Rising
Author of The Pattern Almanac 2000


Linda Rising<br />Author of <a href="http://www.awprofessional.com/title/0201741571" target="_blank" rel="nofollow">Fearless Change</a>
Tony Chen
Ranch Hand

Joined: Jan 29, 2001
Posts: 286
As mentioned in the course OOUML I'm taking right now, Observer is also known as Publish-Subscribe & Dependents Patterns.
Problem:
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Participants:
Subject, Observer, ConcreteSubject, ConcreteObserver
a.k.a.:
Publish-Subscribe, Dependents
Known uses:
Java's Observable class and Observer interface.
Java's Model-View-Controller (MVC) architecture in Swing.
Java's Delegate Event Model.
IBM VisualAge Notification Framework used in Smalltalk and C++ Visual Builders.
Microsoft Foundation Class (MFC)'s Document View architecture.


SCJP Java 2 - IBM Certified Enterprise Developer - WebSphere V4.0 & V5.0 - IBM Certified System Administrator - WebSphere Network Deployment V6.0 - Canadian Securities Course (CSC) Certification
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could someone explain the listener pattern
 
Similar Threads
MVC Controller vs listener
what are container callback methods??
What is teh difference between comparator and equals
Connection pooling using which design pattern ?
Events and Listener List