You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Remy Maucherat <re...@apache.org> on 2001/06/14 02:58:58 UTC
Re: XML data inside a NodeProperty
> Remy,
>
> May I offer a suggestion for the NodeProperty functionality? First let me
> think out loud for a second. My first impression of the NodeProperty made
> me think the getValue() would allow me to retrieve any Object value.
> Meaning when I set the property initially the slide API was taking that
> "property" object and serializing it. Then it would restore that object
> when needed. I just looked at the slide source to see how you're doing it
> and it simply calls object.toString(). Therefore that's not the way
you're
> doing this way. Oh well.
>
> So do I still need to offer my suggestion? :)
Yes :)
> I know this kinda serializable functionality can be implemented by the
> RevisionDescriptorStore but if you're thinking about locking in the
> setValue(Object) type checking functionality then I suggest you make sure
> the object implements Serializable or in the case of a String that it's
well
> formed. Note that a fellow coworker thinks doing the well-formed thing is
a
> mistake. Simply because you'll loose a lot of functionality in this sense
> you can't simply say setValue( "foo", "bar" ). This might solve the
problem
> concerning the String issue, add a validate() method to make sure the
String
> is well formed.
>
> So if you decide to go with the Serializable route then getType() could
> return the Class object. This way you can have the best of both world's.
> You can store a live JAVA XML object like a Element, Document and even
> Beans. Then you can still enforce well formed XML on String objects or
just
> leave the strings alone.
>
> What do you think?
Can't we do both ?
Something like :
- If it's a String, then check if it's well formed
- If it's a simple type, then do an intelligent marshalling to a String (and
set the type appropriately)
- If it's a DOM or JDOM element, then marshall/unmarshall it to a String
(and set the type appropriately)
- If it's something else, use Java serialization (serialization is super
expensive, so I think it should be used as little as possible), and set the
type
Obviously, things are working reasonably fine at the moment, so I'm cautious
about changing things ...
> Personally I think it's kick ass. Oh crap! I just
> realized something, I'm a geek. :) Oh well gotta run, my beamer just got
> detailed and I need to get some time in on the yacht before the summer
ends
> and I have to head to the Keys for the winter. Sweet! :) Okay, so the
> beamer
> part isn't true yet but I guess can still live with being a geek.
lol.
> BTW - Should I join slidedev for future postings like this?
Yes.
Remy