Here we shall define the four most used design patterns regarding XML schema, which are Russian Doll, Salami Slice, Venetian Blind, and Garden of Eden. These patterns can be distinguished by two easy conventions,
- Ease of use for instance developers
- Ease of reuse for schema developers
Russian Doll
In this XML Schema design pattern there is only one global element and all other elements are local.
Advantages
- Contains only one valid root element.
- Could reduce the complexity of namespace, depending on the elementFormDefault attribute of the schema.
Disadvantages
- Allows reuse for all or no elements.
- Supports single-file schemas only.
-
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
-
targetNamespace="http://schemas.sun.com/point/russiandoll"
-
-
xmlns:tns="http://schemas.sun.com/point/russiandoll"
-
-
elementFormDefault="qualified">
-
-
<xsd:element name="Line">
-
-
<xsd:complexType>
-
-
<xsd:sequence>
-
-
<xsd:element name="PointA">
-
-
<xsd:complexType>
-
-
<xsd:attribute/>
-
-
<xsd:attribute/>
-
-
</xsd:complexType>
-
-
</xsd:element>
-
-
<xsd:element name="PointB">
-
-
<xsd:complexType>
-
-
<xsd:attribute/>
-
-
<xsd:attribute/>
-
-
</xsd:complexType>
-
-
</xsd:element>
-
-
</xsd:sequence>
-
-
</xsd:complexType>
-
-
</xsd:element>
-
-
</xsd:schema>
Salami Slice
All the elements in the Salami Slice design are global, hence many potential root elements.
Advantages
- No nesting of element declarations is required and you can reuse the declarations throughout the schema.
- Supports reuse of elements from other documents.
- You must define all the elements within the global namespace
Disadvantages
- Exposes the complexity in namespace.
- Renders the root difficult to determine.
-
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
-
targetNamespace="http://schemas.sun.com/point/salami"
-
-
xmlns:tns="http://schemas.sun.com/point/salami"
-
-
xmlns="http://schemas.sun.com/point/salami"
-
-
elementFormDefault="qualified">
-
-
<xsd:element name="PointA">
-
-
<xsd:complexType>
-
-
<xsd:attribute/>
-
-
<xsd:attribute/>
-
-
</xsd:complexType>
-
-
</xsd:element>
-
-
<xsd:element name="PointB">
-
-
<xsd:complexType>
-
-
<xsd:attribute type="xsd:integer"/>
-
-
<xsd:attribute/>
-
-
</xsd:complexType>
-
-
</xsd:element>
-
-
<xsd:element name="Line">
-
-
<xsd:complexType>
-
-
<xsd:sequence>
-
-
<xsd:element ref="PointA"/>
-
-
<xsd:element ref="PointB"/>
-
-
</xsd:sequence>
-
-
</xsd:complexType>
Venetian Blind
It is an extension of Russian Doll design pattern. Venetian Blind contains only one global element and all other elements are local. You nest element declarations within a single global declaration by means of named complex types and element groups. You can reuse those types and groups throughout the schema and must define only the root element within the global namespace.
Advantages
- Contains only one single root element.
- Allows reuse for all the types and the
- Single global element.
- Allows multiple files
Disadvantages
- Limits encapsulation by exposing types.
-
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
-
targetNamespace="http://schemas.sun.com/point/venetianblind"
-
-
xmlns:tns="http://schemas.sun.com/point/venetianblind"
-
-
xmlns="http://schemas.sun.com/point/venetianblind"
-
-
elementFormDefault="qualified">
-
-
<xsd:complexType>
-
-
<xsd:attribute/>
-
-
<xsd:attribute/>
-
-
</xsd:complexType>
-
-
<xsd:element name="Line">
-
-
<xsd:complexType>
-
-
<xsd:sequence>
-
-
<xsd:element/>
-
-
<xsd:element/>
-
-
</xsd:sequence>
-
-
</xsd:complexType>
-
-
</xsd:element>
-
-
</xsd:schema>
Garden of Eden
Is a combination of Venetian Blind and Salami Slice. There are many potential root elements so there are many element or types become global. You define all the elements and types in the global namespace and refer to the elements as required.
Advantage
- Allows reuse of both elements and types.
- Allows multiple files.
Disadvantage
- Contains many potential root elements.
- Limits encapsulation by exposing types.
- Garden of Eden is difficult to read and understand
-
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
-
targetNamespace="http://schemas.sun.com/point/gardenofeden"
-
-
xmlns="http://schemas.sun.com/point/gardenofeden"
-
-
elementFormDefault="qualified">
-
-
<xsd:complexType>
-
-
<xsd:attribute/>
-
-
<xsd:attribute/>
-
-
</xsd:complexType>
-
-
<xsd:complexType>
-
-
<xsd:sequence>
-
-
<xsd:element ref="PointA"/>
-
-
<xsd:element ref="PointB"/>
-
-
</xsd:sequence>
-
-
</xsd:complexType>
-
-
<xsd:element name="PointA"/>
-
-
<xsd:element name="PointB"/>
-
-
<xsd:element name="Line"/>
-
-
</xsd:schema>
Posted in
Tags: 
Appreciating an article like this is really will make me happy. Spamming has really been an abuse, not only blaming the site quality but also wasting an article of such information, publishers are really happy when they get comments appreciating their hard work, But it hurts when its spammed just for promotion of a product but not the information.
I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks – you cleared up some things for me…
That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.
great post as usual!
Hello! fadekge interesting fadekge site!
There is apparently a whole lot to encounter all-around this. I think about you manufactured some pleasant exhibits in Functions also.
That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.
I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful.
valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up!
Hey…..nice post!!
Awesome, No more words to explain
just….cool blog.
hello it is my first reply on this web and in the begining I would like to thank for the unique information, which I found in this and all previous posts , it really helped me a lot. I will definitely put this blog on my rss reader
Also, I would like to ask – don’t you mind if I will quate some information from your blog since I am writing articles for the Bukisa, Ezine and other articles directories (this is my part time job)? It would really help me with some of mine articles. Of course, I will mention your blog title or URL (not all articles directories allows URL’s , so I can’t 100% promise that you will get a direct backlink to your website).
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
Kompletnie przerobiona w Photoshopie.
Advantageously, the post is in reality the best on this notable topic. I harmonise with your conclusions and will thirstily look forward to your future updates. Saying thanks will not just be enough, for the wonderful clarity in your writing. I will instantly grab your rss feed to stay informed of any updates. Gratifying work and much success in your business dealings!
Nice template and great article.thanks this is great information.
That’s interesting. I’m from London and see the same attitude. Anyway, I’m gonna back before too long
Yahoo News…
I saw this really great post today….
Yahoo News…
This is really great news today….
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very assistive to me and I am sure to all the commenters here! It’s always good when you can not only be informed, but also encouraged!
Has the hype of Obama gone down or does it remain still the same ?
Thanks very good for report, I follow your blog
Nice template and great article.thanks this is great information.
Thank you for your refreshing article. It was a pleasure reading it. Look forward to more articles from you!
I have to state, that i could not acknowledge with you in 100%, but that it is just my opinion, which could be incorrect.
Hi there could I use some of the material found in this entry if I reference you with a link back to your site?
Dean’s 07-inch LCD Car Nabigeshonmediasenta 2 GPS w / Bluetooth ……
Din 7-inch LCD 2 GPS Bluetooth can not find a safer driving experience more fun. 07-inch LCD touch screen vibrant, this unit is designed so ……
hello, found bing to your this blog and it appeard wierd but after refresh everything displayed normal. Just thought id let you know and keep up the good work
Thanks for the information..It was very interesting..will visit again soon
I found this information interesting.
Hi i love your blog, found it while randomly surving a couple days ago, will keep checking up please do visti mine if you wish
. Btw yesterday i was having troubles opening the site. Cya…
Thanks for this interesting information.
hey great information your site contains will return when I have time to read more.
With thanks for this process terrific guideline; this is the variety of fact that prevents me though out the day.I have forever long been searching close to for your personal website after I heard about these from a good friend and was happy when I was able to uncover it right after looking out for a while. Being a passionate blogger, I’m pleased to find out other folks taking gumption and instrumental to the community. I just desired to comment to display my appreciation in your publish as it’s especially inviting, and lots of freelance writers will not get the credit they should have. I’m positive I’ll be again and can send out a few of my associates.
Incredible ! That is a Outstanding Article ! Thanks So Much, I just Saved as a favorite your site, Wish that you will come up with a lot more information just like that.
Noticed your Webblog bookmarked on Reddit.I appreciate your web blog and marketing and advertising tactic. Verify out my Farmville Guideline if you get yourself a moment.
I have been looking for reliable suggestions on gardening and think that your site is a good source of information. It is not easy to locate savvy ideas on the Web, but I think I can use this information! If you are aware of any more savvy suggestions, please don’t hesistate to publish them. Thanks a bunch!
,
Have a nice day
Edwas
Many thanks for providing these beneficial advise.
Really nice style and design and wonderful articles , absolutely nothing else we want : D.
Thank you a bunch for sharing this with all people you actually know what you’re speaking approximately! Bookmarked. Kindly also consult with my website =). We may have a hyperlink exchange agreement between us!
We value the post
Right now firefox automatically downloads an mp3 and opens it. I want it to prompt me with the dialog box so I can choose where to save it. I’ve looked in options->downloads->view and edit actions and there is nothing set there that I can change..
Thank you for another essential article. Where else could anyone get that kind of information in such a complete way of writing? I have a presentation incoming week, and I am on the lookout for such information.5.
The beauty of these blogging engines and CMS platforms is the lack of limitations and ease of manipulation that allows developers to implement rich content and ‘skin’ the site in such a way that with very little effort one would never notice what it is making the site tick all without limiting content and effectiveness.
My dear,you write very good articles,I come from GroupGold,Did you know,GroupGold Was a professional Buy WoW Gold customers trusted sites,Here you can find WoW GoldWoW Gold,Here,we will give you the best service,Beloved,what can i do for you ?
This pattern is magnificent! You most unquestionably understand how to maintain a reader entertained. Among your wit along with your movies, I used to be more or less moved to get started on my individual webpage (perfectly, essentially…HaHa!) Exceptional task. I definitely liked that which you needed to say, and much more than that, the way you introduced it. Far too great!
Do you people have a facebook fan web page? I looked for one on facebook or myspace but could not discover one, I would love to become a fan!