On Mar 21, 2006, at 7:26 PM, Jeremy Boynes wrote:
The answer to that will depend on how the data for this will be
represented in the XML and what binding technology you wish to use to
deserialize it.
With the StAX approach, it can be any deserialization approach that
can
read a XMLStreamReader. That could be SDO (after Raymond's work),
although as you are using a concrete class I think the SDO
configuration
would be "interesting"; it could be ADB, JAXB, XMLBeans or Castor; or,
as last resort, you could provide your own StAXElementLoader that was
designed specifically to handle <jim:foo> elements.
With the SDO approach, you could (somehow) register an XML schema with
the SDO implementation which would result in an typed SDO being
created;
Is this done at development time or runtime?
if not then the physical model would contain an ANY object. Given you
have a class not an interface, you may also need to plug a
converter in
(somehow) that could convert the SDO or the ANY into an instance of
your
class (i.e. it would be "interesting").
So I purposely did this as a class since I think it is common for
"data holder" types. Custom deserializers may wind up being something
people commonly want to contribute.
Neither approach supports complex types at the moment - StAX just
supports String, SDO supports any simple type.
This opens the bigger question of how do users contribute data
bindings
into the runtime. I think that is worth discussing in a different
thread :-)
Yes that's another issue we need to tackle
--
Jeremy
Jim Marino wrote:
I have an additional question. If I have a custom complex type,
say Foo
(:-)) what steps do I need to take to have that bound into a
component
property for the StAX and SDO approaches e.g.:
public class Foo{
private String bar;
public void setBar(String val){
bar = val;
}
public String getBar(){
return bar;
}
private Foo foo;
public void setFoo( Foo val){
foo = val;
}
public Foo getFoo(){
return foo;
}
}