Download presentation
Presentation is loading. Please wait.
Published byGriselda Hopkins Modified over 9 years ago
1
UML class diagrams and 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
Comparison XML schema –defines language structure of objects (documents) UML class diagram –defines structure of objects –summarizes program all classes –interfaces
4
Processing of Objects 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.)
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 XML schemas UML class diagrams structure of objects, Java processing Generate a visitor library from class graph for copying, displaying, printing, checking, comparing and tracing of objects.
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 – Disjunction – Repetition –
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*.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.