[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Achieving object model independence


1
At 07:51 PM 11/18/2001 +0100, Bruno Dumon wrote:
>Jim Wissner wrote:
>
>[snip]
>>2. Create my own set of basic interfaces that mirror common object model 
>>components (Document, Element, Attribute), subclass the implementation 
>>classes of the corresponding dom4j/JDOM/DOM classes, set the appropriate 
>>factory methods to create instances of the subclasses that implement my 
>>common interfaces, and return those common interfaces to the rest of my 
>>library.
>>I currently use this method with Xerces in order to implement undo/redo 
>>of DOM mutations, and it is quite effective. Nevertheless this approach 
>>makes me uneasy because it is dependent on utilizing "nonpublic" 
>>components (that is, having to subclass the default implementation 
>>classes which, though often public in the sense of Java scoping, are 
>>sometimes left out of documentation and presumably more subject to change 
>>than the rest of the APIs. Is this true, or am I being overly worrisome?)
>
>Not related to the original subject, but:
>
>To implement undo when using Xerces, you could as well use the DOM 
>mutation events, which Xerces supports. Just register event listeners on 
>the document node for all mutation events. Then it is easy to record all 
>changes so that they can be undone later.
>
>--
>Bruno Dumon
>
>

Yes, thanks..  It's probably a better way to go as far as Xerces is 
concerned.  I believe this is new in DOM Level 2.  I don't remember it 
existing when I originally wrote the undo/redo mechanisms long, long ago. 
I'm reluctant to change to this event system, since of course not all 
object models implement DOM level 2. I'd really like to find a way to make 
these features available to my apps in a cross-object-model way.

Care to comment on this original topic?  Please?  :)  I'm still waiting for 
some great advice.

Thanks,
Jim


--
www.jbrix.org
Open Source Software
Java - XML - Speech Recognition


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.