Thursday, 2 May 2013

XML/ XSD Design Patterns

XML Design Patterns suggested by Oracle

Design Pattern
Characteristics
Advantages
Disadvantages
Russian Doll
Contains only one global element. All other elements are local.
  • Contains only one valid root element.

  • Could reduce the complexity of namespace, depending on theelementFormDefaultattribute of the schema.
  • Allows reuse for all or no elements.

  • Supports single-file schemas only.
Salami Slice
Contains all global elements, hence many potential root elements.
  • Contains all reusable elements.

  • Supports reuse of elements from other documents.
  • Exposes the complexity in namespace.

  • Renders the root difficult to determine.
Venetian Blind
Is an extension of Russian Doll and contains only one global element. All other elements are local.
  • Contains only one single root element.

  • Allows reuse for all the types and the single global element.

  • Allows multiple files.
Limits encapsulation by exposing types.
Garden of Eden
Is a combination of Venetian Blind and Salami Slice. All elements and types are global, hence many potential root elements.
  • Allows reuse of both elements and types.

  • Allows multiple files.
  • Contains many potential root elements.

  • Limits encapsulation by exposing types.

  • Is difficult to read and understand.


For more information refer http://www.oracle.com/technetwork/java/design-patterns-142138.html


No comments:

Post a Comment