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

RE: SOX

  • From: Graham Moore <graham.moore@d...>
  • To: xml-dev@i...,peter@u...
  • Date: Thu, 1 Oct 1998 13:23:45 +0000

sox mapping



peter I agree that the mapping issue is of vital importance. In a similar 
way to the SUN stuff I've developed a domBuilder that can take an XML file 
which specifies the class mapping (example file below) , or can look in a 
given package for classes that match element names and an XML file / stream 
from which to build the structure.

I think there are two points to consider:

1) Possinbly we should be using XML to specify the binding.
2) Leaving scope in the biding spec to allow for the declaration of 
delegation structures.  Given that inheritance is a specialisation of 
delegation perhaps this should happen anyway. In the same way that arbitrary 
functional mapping is undesirable so is  the arbitrary construction of 
delegation structures.

The issue with using inheritance is that the mixin class must inherit from 
the elementNode / generic data object class used in the domBuilder. Using 
delegation and dynamic invocation this is not a problem.

consider

  delObject.tell(objectRef, "method", args);

which could be wrapped further

  system.tell(delObject, "tell", args); where are 0 is the method names and 
1 - n are the real args.

Internally each member of the delegation structure would have to be aware 
they were in one but this is generically handled by

public class delMemeber {
   private Object outerSelf;

   public void doit(){
     String att val =  (String)system.tell(outerSelf, "getAttribute", args);
   }

}

So the delmember would not have to subclass any elementNode object, just 
implement the delMember interface.

public  interface delegationMember {
   private Object outerSelf;
   void setOuterSelf(Object os);
}

This means that domBuilder writers subscribe to acknowlege the contract of 
intialising the classes appropriately and class writers can easily write and 
bind objects.

This does require a bit of a mind set change for one thing there is no 
compile time error generation. But perhaps this is a price worth paying for 
a more dynamic, open and flexible system. It would be nice if java supported 
delelgation and dynamic invocation as part of the langauge; writing it on 
top seems a bit messy.

Example functional mixin file: This is very simplistic but illustrates what 
we could do. I haven't considered the delegation structure in any real 
depth.

<?xml version='1.0'?>
<mixins>
<mixinassoc elem="breakfast-menu" jclass="grove.menu"/>
<mixinassoc elem="food" jclass="grove.food"/>
</mixins>

What do people think?

graham.

gdm@d...








xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


  • Follow-Ups:
    • Re: SOX
      • From: David Brownell <db@E...>

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.