Great - however this is still exploiting the "implicit interface" exposed by a function object. So while there is no explicit observer interface with an explicit notify operation, the principal operation on a function object still serves the same purpose. If pressed you could simply declare an EventHandler marker interface (i.e. no operations) in your model. To communicate the intent of using a function object as an EventHandler simply have it realize the
EventHandler interface. Then your subscribe operation can accept an
EventHandler parameter. In sequence and collaboration diagrams you simply call the function object's principal operation.
(Personally I would probably still put a
notify or some such operation on the
EventHandler interface � then create an �Event Handler� stereotype with the declaration that �Event Handler� classes map the
notify to their principal operation).
Though you really have to ask yourself whether you want to model to that level of detail (
Agile Modeling Practices).
Apparently there is WAE-UML (Web Application Extension-UML) which is described in:
Building Web Applications with UML, 2nd Edition (
amazon US)
Modeling Web Application Design with UML (White Paper) Not sure how useful it would be (it's potentially dated).
I can't remember the last time I purchased a book in a brick-and-mortar store. As I mentioned before, there is an updated version (July 2006) available if you don't mind C# and .NET:
Agile Principles, Patterns, and Practices in C# (
amazon US)
[ May 08, 2007: Message edited by: Peer Reynders ]