PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: myIP on April 16, 2009, 05:42:54



Title: Any need for an Event type and/or Data type in PureMVC?
Post by: myIP on April 16, 2009, 05:42:54
Is there any need to use an Event type and/or Data type between the 3 tiers in a PureMVC application?  Some 3rd party libraries seem to use them, however, in most if not all examples from puremvc.org uses just value-objects and enums.  In other words, if the 3rd party library (such as XIFF) uses an event type and data type, should I use them instead of value-objects and enums?  Or should I use both? 

Thanks.


Title: Re: Any need for an Event type and/or Data type in PureMVC?
Post by: puremvc on April 16, 2009, 06:18:01
Certainly, you may use any custom datatypes that must pass between your model and view tiers. VOs and Enums are just handy patterns to use if you are starting from scratch.

In the case you mention, XIFF, you have custom datatypes like Roster, Message and Presence. These typically will have to make it across the tiers to a view.

Fortunately, Dave Keen has put together a very keen (heh.. heh..) PureMVC/XIFF demo which you can check out here:

http://www.actionscriptdeveloper.co.uk/puremvc-tutorial-flex-puremvc-jabber-and-xiff-3-introduction/

-=Cliff>


Title: Re: Any need for an Event type and/or Data type in PureMVC?
Post by: myIP on April 19, 2009, 02:28:34
I started off 2 months ago with that tutorial!  I wanted to learn just PureMVC and when I was half way thru it, I realized I needed to learn XIFF.  Now I am doing an IM application in Flex.  Its coming along, but just ran into a crux last week with it.

The reason why I asked the question in my original post is because, documentation for XIFF (beta version) is scarce.  I see that it has a data and event package, but I am unsure on when and how to use them.  So I think, I am going to take another attempt to implement them into my project.  But if the attempt ultimately fails, then I will use custom value-objects.

Thanks again.