incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Incubator Wiki] Update of "SynapseProposal/synapseobject" by AleksanderSlominski
Date Thu, 23 Mar 2006 16:33:01 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Incubator Wiki" for change notification.

The following page has been changed by AleksanderSlominski:

  From a generic standpoint both give the notion of a person’s address, XML-1 in this context
could be treated as more appropriate as it depicts that a contact has attributes in the form
of objects, where each composite object within has an identity of it’s own or each of then
can exists even if the contact object is not present but if you think deep, would they meaningfully
exist? Not really. At such a granular level it would become a nightmare to maintain them,
there could be two people with the same name.  
  On the other hand XML-2 is more of a wysiwyg (What you see is what you get) but readability
wise maybe not be that great. 
  There are different school of thoughts in using XML but then XML has been conceived in a
fashion, which allows representation of data in any way users wish to put it. 
+ Unfortunately those examples are too simplistic to be of practical value and non of approaches
work well to model more complex data.
  However this gets more interesting if address is represented as extensible data structure
where street is not mixed with concept of address and a person may have multiple addresses
but still we attach only one name to a contact (so attribute is very well fitting):
@@ -82, +84 @@

  This of course gives immense control to the person who is writing it but then introduces
a whole lot of ambiguity when a different person gets it. The reason being the context is
lost in transmission.  At one end there is a whole lot of flexibility and on the other end
  To resolve this issue, XSDs have been used to validate xmls from either end and provide
some control for type validation. Going forward Data-binding mechanisms have provided users
to produce classes/jars from an XSD and then using XMLs(conforming to the XSD) generate instances
that could be used for performing certain tasks. 
+ {{{
+ Note: it is possible to use XML without any databinding and just with lightweight validation
(using XML schema or RELAX NG) 
+ }}}
  Take for instance XMLBeans from Apache, which generates java classes from a given XSD and
then allows you to get instances by passing an XML, which subscribes to the XSD format.
@@ -89, +96 @@

  For the adventurous few, try out XMLBeans on the above 2 XMLs.
  XML 1 - Leads to too many classes to handle
  XML 2 - The code is quite cryptic
- XML 3 - appropriate mix of elements and attributes to represent data 
  === From a logical perspective (using XMLBeans) ===
@@ -417, +424 @@

  String priority = service.getString("priority");
+ = Simplified XML (XML-N) =
+ It uses XML attributes for SynapseObject Attribute and simple convention to represent type
"{type}value" ex. "{int}10" 
+ and it should be possible to write XML schema to validate such values if there was ever
need (break string
+ into type "{int}" and valudate rest against XML schemas xsd:int)
+ {{{
+ <ConsumerIdentification>
+  <consumer consumer-type="GOLD" ip-address-from="" ip-address-to=""
+    http-auth-username="john" ws-sec-username="john"
+  >
+    <assignedService>stockQuote1</assignedService>
+    <assignedService>waterMeter</assignedService>
+  </consumer>
+ </ConsumerIdentification>
+ }}}
+ It is both short and can be validated. And cvan be automatically processed to provide
+ functionality of SynapseObject API

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message