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]
Print
Author Topic: Hierarchical VOs  (Read 7449 times)
jonbonbon
Newbie
*
Posts: 2



View Profile WWW Email
« on: July 01, 2010, 03:11:07 »

Hi, this is my first post so excuse the noob question. Still trying to get my head around the framework.
Also this might be more related to AS3 in general.. not sure...

I have a hierarchical set of data that I need to represent in the model. The structure looks like this:

-- set of shapes
---- shape
------ shape id
------ shape name
------ shape colour
------ set of coordinates
-------- coordinate
---------- x
---------- y

I've created one proxy and three VOs:

ShapeDataVO - contains an array of ShapeVOs
ShapeVO - conatins shape details and an array of CoordinateVOs
CoordinateVO - conatins x y coordinates

The proxy is responsible for providing an API for all three VOs.

Is it good practice to have more than one VO to a proxy?
Perhaps I should create one VO that somehow represents the full data on its own?

Thanks in advance for any help!
Logged
Sammi
Courseware Beta
Full Member
***
Posts: 45


View Profile Email
« Reply #1 on: July 01, 2010, 07:56:38 »

Hi,

The proxy could have just the ShapeDataVO. The ShapeDataVO has getters like:

- getAllShapes():Vector.<ShapeVO>
- getShapeByID():ShapeVO

The ShapeVO has a getter to return CoordinateVO's:

- getCoordinates():Vector.<CoordinateVO>

I would search the forums for "SmartVO"

Best,
Sammi
Logged
jonbonbon
Newbie
*
Posts: 2



View Profile WWW Email
« Reply #2 on: July 01, 2010, 03:29:33 »

Thanks sammi that makes much better sense!
Logged
Pages: [1]
Print