XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: Flatter is Better (part two)

Hi Roger,

 

How about using a “relational” structure, as below? It avoids both the duplication inherent in the “flat” and the depth of structure of the “fat”.  It is easy enough to transform to either of the other two structures.

 

John

 

<document>

      <states>

            <state ref="IA">

                  <name>Iowa</name>

                  ...

            </state>

            <state ref="NY">

                  <name>New York</name>

                  ...

            </state>

            ...

      </states>

 

      <citys>

            <city ref="234123">

                  <name>Davenport</name>

                  <state-ref>IA</state-ref>

                  <pop>382630</pop>

                 

                  ...

            </city>

            <city ref="3828">

                  <name>Cedar Rapids</name>

                  <state-ref>IA</state-ref>

                  ...

           

            </city>

            ...

      </citys>

 

      <streets>

                  <street ref="234235">

                        <name>"Arlington Court"</name>

                        <zip>IA 52803</zip>

                        <city-ref>234123</city-ref>

                  </street>

                  ...

                       

      </streets>

      <houses>

     

            <house ref="3fsdh89">

                  <street-ref>234235</street-ref>

                  <street-number>1009</street-number>

                  <style>Ranch</style>

                  <porch>open</porch>

                  <year-built>1951</year-built>

                  <square-feet>1700</square-feet>

                  ...

            </house>

           

            <house ref=”xyix3sf”>

                  <street-ref>234235</street-ref>

                  <street-number>1008</street-number>

                  <style>Ranch</style>

                  <porch>closed</porch>

                  <year-built>1955</year-built>

                  <square-feet>1850</square-feet>

            </house>

 

            ...

      </houses>

<document>

 

 

 

From: Costello, Roger L. [mailto:costello@mitre.org]
Sent: 02 December 2014 10:31
To:
xml-dev@lists.xml.org
Subject: [xml-dev] Flatter is Better (part two)

 

Hi Folks,

 

The flat design is about creating XML documents that consist of a long series of standalone components:

 

cid:image001.png@01D00E4C.9037E530

 

A component in the document can be combined with other data (mashup):

 

cid:image002.png@01D00E4C.9037E530

Let’s take a concrete example to compare the flat design versus the fat design.

 

Here is a flat design:

 

<Iowa>
   
<house>
       
<street>1009 Arlington Court</street>
       
<city>Davenport</city>
       
<style>Ranch</style>
       
<porch>open</porch>
       
<year-built>1951</year-built>
       
<square-feet>1700</square-feet>
   
</house>
   
<house>
       
<street>1008 Arlington Court</street>
       
<city>Davenport</city>
       
<style>Ranch</style>
       
<porch>closed</porch>
       
<year-built>1955</year-built>
       
<square-feet>1850</square-feet>
   
</house>
    ...
</Iowa>

 

The document consists of a long series of standalone <house> components. Any of those <house> components could be mashed-up with other data, e.g., mashup a <house> component with a <GPS> component.

 

Here is a fat design:

 

<Iowa>
   
<city name="Davenport">
       
<street name="Arlington Court">
           
<house>

               <street-number>1009</style>
               
<style>Ranch</style>
               
<porch>open</porch>
               
<year-built>1951</year-built>
               
<square-feet>1700</square-feet>
           
</house>
           
<house>

                <street-number>1008</style>
               
<style>Ranch</style>
               
<porch>closed</porch>
               
<year-built>1955</year-built>
               
<square-feet>1850</square-feet>
           
</house>
       
</street>
        ...
q         
   
</city>
   
<city name="Cedar Rapids"> ... </city>
    ...
</Iowa>

 

The flat design and the fat design are radically different!

 

In the fat design the houses have been grouped into streets and the streets have been grouped into cities. The street name data has been removed from each <house> and also the city name data has been removed from each <house>. Consequently, each <house> is no longer a standalone component. House data is now fragmented, scattered over the document. The ability to do mashups has been lost (or, at least, greatly hampered). The fat design has normalized the data and, as I argued in my last message: Normalization is horrible for data exchange formats.

 

It’s best to exchange the data in the flat design. Consumers can transform it into the fat design, if needed.

 

Recommendation: When designing a data exchange format create a flat design.

 

Comments?

 

/Roger



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS