An ICollectionView is used for representing a collection of data and is passed to the various List-based controls.  A change to the collection (like removing an item) is automatically noticed by a control which makes it easy for the developer.  A Model is just a nice way of describing an anonymous object structure.  It feels like XML somewhat so it’s nice for quickly putting together a data model.  If you expect the data to change a fair amount and it needs to show up in a DataGrid or List, use the ICollectionView (in this case ArrayCollection) directly.  If you just want to write out a data structure use the Model.

 

In Flex 2 I think we’ll encourage using strongly typed classes more and more and also encourage using <mx:XML> instead of Models since e4x will be supported.  But it will be interesting to see where people want to use what…

 

HTH,

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Sean Tierney
Sent: Tuesday, November 15, 2005 3:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] difference between data models and collectionviews?

 

can anyone explain how they are different and when it's appropriate to
use each?  My current understanding is that both create a local object
that serves as a handle to better manipulate the underlying data it
represents.  I'm not clear on when it's appropriate to use one vs. the
other though- seems like using <mx:model> is easier since it can turn
XML data into an Actionscript object automatically... or maybe they
are for totally different purposes and i'm just missing something
entirely.

thanks
sean
--
www.LightsOutProduction.com



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to