1 / 12

UML class diagrams and XML schemas

UML class diagrams and XML schemas. Karl Lieberherr UBS AG Northeastern University. Overview. Translation from UML cds to XML schemas Other standards beyond XML: Structure-shy object pattern Navigation through XML documents (and object structures): Structure-shy traversal pattern.

yank
Télécharger la présentation

UML class diagrams and XML schemas

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UML class diagramsand XML schemas Karl Lieberherr UBS AG Northeastern University

  2. Overview • Translation from UML cds to XML schemas • Other standards beyond XML: Structure-shy object pattern • Navigation through XML documents (and object structures): Structure-shy traversal pattern

  3. XML schema defines language structure of objects (documents) UML class diagram defines structure of objects summarizes program all classes interfaces Comparison

  4. XML XSLT, JSP programs (Java etc.) Document Object Model provides a standard set of objects for representing XML documents Fine grained model: one element - one class SAX UML programs (Java etc.) Processing of Objects

  5. What brings XML? • Agreement at syntax level • several proposals to write schemas • useful to have unified, simple approach to define mark-up languages • Still need agreement at semantic level • hard data integration problems not eliminated

  6. Commonality Generate a visitor library from class graph for copying, displaying, printing, checking, comparing and tracing of objects. XML schemas UML class diagrams structure of objects, Java processing

  7. What can OO designers learn from XML? • It is useful to separate the structure of your design from the implementation • E.g., XSLT descriptions are distinct from schemas • It is useful to view an OO design as a grammar that defines application specific objects

  8. What are the basic elements of XML? • Sequence • <!ELEMENT Compound (Op , Exp , Exp )> • Disjunction • <!ELEMENT Exp (Simple | Compound )> • Repetition • <!ELEMENT Author (Person , Publication* )>

  9. What are the basic elements of UML class diagrams? • Sequence - Concrete Classes • Compound = (op Op , arg1 Exp , arg2 Exp ) • Disjunction - Abstract Classes • Exp = (Simple | Compound ) • Repetition - Collection classes • Author = (Person , Publication* )

  10. Avoid duplication! • We should define a systematic process to generate XML schemas from UML class diagrams • Has many benefits: • more flexible • easier to maintain

  11. How do we have to write UML class diagrams? • To make the translation easy (and to improve the UML class diagram) • Classes are partitioned into abstract classes and concrete classes. Abstract classes have at least one subclass. • Follow the Abstract Super Class rule (ASR). That means that all superclasses should be abstract.

  12. UML Cd to XML Schema The translation algorithm roughly proceeds as follows: • Flatten the UML class diagram, i.e., push all parts of abstract classes down to concrete classes. Replace undirected associations by two directed associations.Follow the ordering of parts and the ordering policy. • Concrete classes are translated into a schema element A of the form (B1, B2, B3, ...). • Abstract classes are translated into a schema element of the form A (B1 | B2 | B3 | ...). • An optional part B is represented as B?. A repeated part B is represented as B+ or B*.

More Related