Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Public Demos, Tools and Applications / PureMVC Metatags helper for Mediators on: January 05, 2009, 09:35:42
Hi,

PureMVC is a great framework for developing RIAs. But sometimes it can require some repetitive and "useless" code from business point of view.

In my opinion, the biggest flaw is with the mediator, its listNotificationInterest() and handleNotification() methods that are the same for all mediators. Especially handleNotification(), which must contain a dumb switch/case testing all notification names and map them to private handlers.

So I wrote a little mediator adapter, called "MetadataMediator" that you should extend instead of regular PureMVC mediator. It enables you to remove those functions from your mediator and replace them with custom metatags declared at the top of your class:

[ListenTo(name=NotificationName,handler=HandlingFunction)]

And that's all :)

But it has some drawbacks too, please see the MetadataMediator source code in the following demo:
http://prog.13.free.fr/metatags_demo/TestMetaData.html (right click -> Source code).

Your comments are welcome !

Avangel.
Pages: [1]