La lecture en ligne est gratuite
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
Télécharger Lire

Design and implementation of a database programming language for XML-based applications [Elektronische Ressource] / vorgelegt von Henrike Schuhart

179 pages
Aus dem Institut fur¨ Informationssystemeder Universitat¨ zu Lubeck¨Direktor:Prof. Dr. rer. nat. Volker LinnemannDesign and Implementation of a DatabaseProgramming Language for XML basedApplicationsInauguraldissertationzurErlangung der Doktorwurde¨¨ ¨der Universitat zu Lubeck- Aus der Technisch Naturwissenschaftlichen Fakultat¨ -Vorgelegt vonHenrike Schuhartaus GeesthachtLubeck,¨ Marz¨ 2006iiAcknowledgementsThis work is the result of my research during the last three years. I have been working as aresearch assistent at the institute of information systems of the university of Lubeck.¨ It startedwith searching for suitable topics in context of the predecessor project XOBE and proceeded tofinding solutions, implementing the prototype and finally writing this doctoral thesis. During allthis time a lot of people have supported my work and goals. Now I want to express my thanksto all involved persons.My special thanks goes to my supervisor Prof. Dr. Volker Linnemann, who is also thedirector of the institute where this work has been developed. I appreciate that he always hadtime to discuss, criticize and support my research. I thank Prof. Dr. Stefan Fischer for beingthe second referee, which is connected with a non negligible amount of time. Likewise I wouldlike to thank Prof. Dr. Bernd Fischer to be the chair of the examination board.Many thanks as well to my colleague Beda C.
Voir plus Voir moins

Aus dem Institut fur¨ Informationssysteme
der Universitat¨ zu Lubeck¨
Direktor:
Prof. Dr. rer. nat. Volker Linnemann
Design and Implementation of a Database
Programming Language for XML based
Applications
Inauguraldissertation
zur
Erlangung der Doktorwurde¨
¨ ¨der Universitat zu Lubeck
- Aus der Technisch Naturwissenschaftlichen Fakultat¨ -
Vorgelegt von
Henrike Schuhart
aus Geesthacht
Lubeck,¨ Marz¨ 2006iiAcknowledgements
This work is the result of my research during the last three years. I have been working as a
research assistent at the institute of information systems of the university of Lubeck.¨ It started
with searching for suitable topics in context of the predecessor project XOBE and proceeded to
finding solutions, implementing the prototype and finally writing this doctoral thesis. During all
this time a lot of people have supported my work and goals. Now I want to express my thanks
to all involved persons.
My special thanks goes to my supervisor Prof. Dr. Volker Linnemann, who is also the
director of the institute where this work has been developed. I appreciate that he always had
time to discuss, criticize and support my research. I thank Prof. Dr. Stefan Fischer for being
the second referee, which is connected with a non negligible amount of time. Likewise I would
like to thank Prof. Dr. Bernd Fischer to be the chair of the examination board.
Many thanks as well to my colleague Beda C. Hammerschmidt for encouraging discussions
in context of my work, in particular reading and improving my publications. Special thanks as
well to Dominik Pietzsch with whom I developed the persistency layer for XOBE , whichDBPL
is now going to be an independent project.
I would like to thank Simon Gilbert for proof reading this work in English.
Finally I want to thank my friend Roberto for supporting me and my work all the time.
Thanks especially to my parents Helmut und Heidi Schuhart for providing me with a smooth
study and education right from the beginning. Moreover they have always encouraged my plans.
Lubeck,¨ June 2006 Henrike SchuhartivAbstract
XML is the de facto standard for data exchange between arbitrary applications. These ap
plications are written in object oriented programming languages like Java or C# for example.
Consequently the need arises to integrate XML into existing object oriented programming lan
guages. Moreover, many applications have to keep and deal with persistent data and objects.
A lot of frameworks are currently being developed which are trying to solve mismatch prob
lems between the transient object model and the persistent data model. Due to performance
reasons relational databases are taken in general. Although existing approaches try to mini
mize the mapping effort, true transparent persistency is not gained at the moment. In this work
transparent persistency means that objects can be stored regardless of type, algorithms remain
unchanged whether they operate on persistent or transient data and finally that programmers,
if at all, deal with persistency on a very high level. In addition many persistence solutions do
not even support the main object oriented concepts like inheritance and polymorphism. As well
object oriented databases are limited to a single programming language and are rarely avail
able. All that the frameworks or approaches mentioned so far have got in common is that the
programmer has to add special code when dealing with persistent objects or classes. The code
includes communication with a so called persistency manager for example. In the past several
database programming languages have been developed, but they all have tried to integrate the
relational model. Consequently, a holistic and transparent solution is needed that integrates
XML and persistency into an existing object oriented programming language.
In this work XOBE (XML OBjEts DataBase Programming Language) is developedDBPL
as an extension of the object oriented programming language Java. XOBE is based onDBPL
its predecessor project XOBE. In XOBE XML and XPath are already integrated and checked
statically at compile time against an XML schema. XML Schemas and DTDs are supported
as XML schema description languages. In XOBE XML objects can now be manipulatedDBPL
with the help of updates. Moreover the type checking process of XOBE is extended to support
updates and more complex queries as well. Additionally, transparent type independent persis
tency supporting all object oriented concepts is introduced inXOBE for the first time. TheDBPL
prototypical implementation is based on a persistency layer using web services. The persistency
layer keeps persistent objects and data and offers the possibility to exchange data among arbi
trary languages and applications. Moreover, it is shown that the introduced concepts can also
be realized as a semantical extension of Java. Consequently programmers do not have to learn
vvi
a new syntax anymore and existing development environments can be used, which supports
efficiency.Contents
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Goals and Organization of this Work . . . . . . . . . . . . . . . . . . . . . . . 3
2 Basics and Related Work 5
2.1 Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.1 Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.2 The Java Virtual Machine . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.3 The Byte Code Engineering Library . . . . . . . . . . . . . . . . . . . 6
2.2 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.2 XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 XQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5 The Document Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6 XMark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.7 XML Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.8 Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.9 XML in Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . 32
2.10 Persistent XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.11 Database Languages . . . . . . . . . . . . . . . . . . . . . . . . 34
2.12 Distributed and Persistent Objects . . . . . . . . . . . . . . . . . . . . . . . . 36
3 XML Integration 39
3.1 XML Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2 Static Type Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.2.1 XPath Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3 Extended FLWOR . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.3.1 Query Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.3.2 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.4 Dynamic Type Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
viiviii CONTENTS
4 Persistency 67
4.1 Syntax and Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.1.1 Creation and Retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.1.2 Deletion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.2 Realization Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.2.1 Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5 Transactions 77
5.1 Syntax and Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.2 Classification of Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.2.1 Realization Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.3 Concurrency Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.3.1 Realization Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
6 Web Service for Distributed Persistent Objects 85
6.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
6.2 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
6.3 Retrieving Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.4 Storing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.4.1 Registering Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
6.5 Removing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.6 Session and Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7 Architecture and Implementation 99
7.1 Preprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.2 Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.2.1 XML Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
7.2.2 Transaction T . . . . . . . . . . . . . . . . . . . . . . . 120
7.2.3 Structural Transformation . . . . . . . . . . . . . . . . . . . . . . . . 122
7.3 Runtime Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
7.4 OR Mapping Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
7.4.1 Mapping Member Variables . . . . . . . . . . . . . . . . . . . . . . . 123
7.4.2 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.4.3 Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
7.5 Performance Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
8 XOBE as Semantic Extension 127DBPL
8.1 XML Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
8.1.1 XML Schema Import . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.1.2 XML Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
8.1.3 Queries in XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136CONTENTS ix
8.1.4 Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
8.2 Persistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.2.1 Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.2.2 Realization Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
8.3 Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
8.3.1 Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
8.3.2 Realization Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
9 Experimental Results 143
9.1 XML Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.2 Distributed and Persistent Objects . . . . . . . . . . . . . . . . . . . . . . . . 146
10 Conclusions and Future Work 153x CONTENTS

Un pour Un
Permettre à tous d'accéder à la lecture
Pour chaque accès à la bibliothèque, YouScribe donne un accès à une personne dans le besoin