As a rule, I only put string values that never contain special characters in
attributes, otherwise you end up with XML validation errors (like putting
ampersands in attributes).
Also, I generally put parsing code inside the constructor of the VO class (well,
I call deserialize() because code inside constructors are interpreted).
public class ValueObject
{
public var foo:String;
public var bar:String;
public function ValueObject(node:XML)
{
deserialize(node);
}
private function deserialize(node:XML):void
{
foo = no...@foo;
bar = node.bar;
}
}
There are exceptions to this rule, but they're rare.
It makes it really easy to share VOs between multiple service classes when the
parsing logic is contained with the VO instead of each service class (assuming
that the xml is homogenized).
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders