incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Incubator Wiki] Update of "SynapseProposal/synapseobject" by AleksanderSlominski
Date Thu, 23 Mar 2006 16:22:50 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:
http://wiki.apache.org/incubator/SynapseProposal/synapseobject

The comment on the change is:
Aded XML-N

------------------------------------------------------------------------------
  
  == Introduction ==
  
- Data representation has been a tough job always.  But with the advent of XML, representing
them has become much easier but still the data handling intelligence is missing. Say for instance
we have an XML 
+ Data representation has been a tough job always.  But with the advent of XML, representing
them has become much easier but still the data handling intelligence is missing (what is that?).
Say for instance we have an XML 
  
  == XML-1 ==
  
@@ -45, +45 @@

  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. 
+ 
+ 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):
+ 
+ == XML-3 ==
+ 
+ {{{
+ <contacts>
+   <contact name="John">
+     <address>
+       <line1>360 Morse Ave</line1>
+       <city>Sunnyvale</city>
+       <state>US</state>
+       <zip>94086</zip>
+     </address>
+   </contact>
+   <contact name="Mary">
+     <address type="home">
+       <line1>410 Dale Park</line1>
+       <line1>Apt 10</line1>
+       <city>Sunnyvale</city>
+       <state>US</state>
+       <zip>94086</zip>
+     <address>
+     <address type="work">
+       <line1>222 Sunny Blvd</line1>
+       <city>Sunnyvale</city>
+       <state>US</state>
+       <zip>94086</zip>
+     <address>
+   </contact>
+ </contacts> 
+ }}}
+ 
+ 
  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
ambiguity.
  
  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. 
@@ -55, +89 @@

  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) ===

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message