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

Pages: [1]
Author Topic: XML and dropdown menus-use VO(s) to wrap XML or?  (Read 8401 times)
Courseware Beta
Sr. Member
Posts: 81

View Profile Email
« on: October 06, 2011, 08:24:03 »

Smart VO's are great when you have a single entity defined in XML, but what about say, XML for a drop down navigation?
Is there an efficient way to represent this data(multiple entities) using a single 'smart' VO, or is it better to keep the data as XML and let the views do the parsing?
Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #1 on: October 06, 2011, 12:00:55 »

I would avoid doing the parsing in the views. By writing more intelligent VO wrappers for the XML you create a 'Single Point of Truth' or SPOT[1] rather than distributing the XML handling all throughout the app. Because the XML structure is likely to change as you build, if you let disparate parts of the app massage the XML, you're bound to run into duplication of effort. And as the XML changes, inevitably you'll end up going around the app cleaning up all that stuff.

To this point, in a book I'm writing for O'Reilly at the moment, I'm presenting a very deep XML hierarchy, and the VOs wrapping it take on some heavy responsibility that challenge the simple data-carrier notion that is usually associated with VOs. The book won't be out until sometime in December, but being a longstanding PureMVC community member, I can probably get you on the tech review list so you can get an early peek. Just shoot me an email if you're interested.


[1] http://en.wikipedia.org/wiki/Single_Point_of_Truth
Pages: [1]