Thesis Title
Total Page:16
File Type:pdf, Size:1020Kb
Otto-von-Guericke-Universit¨atMagdeburg School of Computer Science Department of Technical and Business Information Systems Master Thesis Feature-Oriented Decomposition of SQL:2003 Author: Sunkle Sagar October 24, 2007 Advisor: Prof. Dr. rer. nat. habil. Gunter Saake, Dipl.-Inform. Marko Rosenm¨uller, Dipl.-Inform. Martin Kuhlemann University of Magdeburg School of Computer Science Department of Technical and Business Information Systems P.O. Box 4120, D{39016 Magdeburg Germany Sunkle, Sagar: Feature-Oriented Decomposition of SQL:2003 Master Thesis, Otto-von-Guericke-Universit¨at Magdeburg, 2007. i Acknowledgements I would like to thank my master thesis advisors for their support and reviews. I would like to thank Prof. Dr. Gunter Saake for his support and confidence in me and allowing me to work on master thesis in his group. I would like to thank Marko Rosenm¨uller, Martin Kuhlemann and Norbert Siegmund for their helpful reviews and suggestions. Marko and Martin reviewed this thesis for smallest details. I would like to especially thank Marko, he was specifically assigned to me for the thesis and without our lengthy and very interesting discussions about various related topics where he tried patiently to answer my innumerable queries orally or by emails, this thesis would not have been possible. Finally I would like to thank my family because of whom this education is made possible for me. ii CONTENTS iii Contents Contents iii List of Figures vii List of Tables ix List of Abbreviations x 1 Introduction 1 1.1 Motivation . .1 1.2 Goals . .4 1.3 Structure of the Thesis . .4 2 Background 5 2.1 SQL . .5 2.1.1 History . .5 2.1.2 Standardization and Evolution . .6 2.2 Software Product Line Concepts . .7 2.2.1 Software Product Line Engineering . .7 2.2.2 Domain Engineering . .8 2.2.3 Application Engineering . 10 2.3 Feature-Oriented Decomposition . 11 2.3.1 Features . 11 2.3.2 Feature Diagrams . 11 2.4 Feature-Oriented Programming . 17 2.4.1 GenVoca . 17 2.4.2 AHEAD . 18 iv CONTENTS 2.4.3 Using GenVoca/AHEAD and Related Tools . 19 2.5 Separation of Concerns . 20 2.6 Summary . 23 3 Feature-Oriented Decomposition of SQL:2003 24 3.1 Feature Modeling Technique for SQL:2003 . 24 3.1.1 Basis for Modeling Features in SQL:2003 . 25 3.2 Feature Diagrams for SQL:2003 . 28 3.3 Sub-grammars Based on Feature Diagrams . 36 3.4 Summary . 41 4 Issues in Feature-Oriented Decomposition of SQL:2003 42 4.1 Other Implementation Models . 42 4.1.1 Superimposed Variants . 42 4.1.2 Hyperspaces . 43 4.1.3 Comparison of Different Implementation Models . 45 4.2 SQL:2003 Specific Issues . 45 4.3 Related Work . 50 4.4 Summary . 52 5 Conclusion 53 5.1 Further Work . 54 Bibliography 56 Appendices A SQL:2003 Feature Diagrams 61 B Taxonomy of SQL Non-Framework Optional Fearures 86 B.1 Java Routines and Types Using the Java Programming Language (SQL/JRT) . 87 B.2 SQL Object Language Bindings (SQL/OLB) . 87 B.3 SQL Persistent Stored Modules (SQL/PSM) . 87 B.4 SQL Management of External Data (SQL/MED) . 88 B.5 SQL XML-Related Specifications (SQL/XML) . 88 CONTENTS v C SQL Platform Support 91 vi CONTENTS LIST OF FIGURES vii List of Figures 2.1 Structure of the SEI Framework for Product Line Practice [CE00] . .8 2.2 Domain Engineering and Application Engineering as parallel processes [CE00] . 10 2.3 Feature Diagram with a concept node and three features. 12 2.4 Feature Diagram with mandatory and optional features. 13 2.5 Alternative and OR features. 13 2.6 AND features. 14 3.1 Parent child relationships in feature diagrams as grammar rules [Bat05]. 26 3.2 Main Feature Diagram of SQL:2003 . 28 3.3 Domain Definition Feature Diagram . 29 3.4 Table Definition Feature Diagram . 30 3.5 View Definition Feature Diagram . 31 3.6 Schema Routine Feature Diagram . 32 3.7 Insert statement Feature Diagram . 33 3.8 Merge statement Feature Diagram . 33 3.9 Query Expression Feature Diagram . 34 3.10 Query Specification Feature Diagram . 35 3.11 Table Expression Feature Diagram . 35 4.1 Overview of Superimposed Variants Approach [CA05] . 43 4.2 Hyperspace matrix with two relevant dimensions; Classes and Features [PRB03] . 44 A.1 SQL/Foundation Feature Diagram . 61 A.2 SQL schema statement Feature Diagram . 62 viii LIST OF FIGURES A.3 Schema Definition Feature Diagram . 63 A.4 Column Definition Feature Diagram . 64 A.5 Sequence Generator Feature Diagram . 65 A.6 Trigger Definition Feature Diagram . 66 A.7 User-Defined Type Definition Feature Diagram . 67 A.8 Grant Privilege Feature Diagram . 68 A.9 Privilege Feature Diagram . 68 A.10 Alter Statements Feature Diagram . 69 A.11 SQL Data Statements Feature Diagram . 70 A.12 Cursor Feature Diagram . 71 A.13 SQL Data Change Statements Feature Diagram . 71 A.14 Delete statement Feature Diagram . 72 A.15 Update statement Feature Diagram . 72 A.16 SQL Transaction statements Feature Diagram . 73 A.17 SQL Control statements Feature Diagram . 74 A.18 SQL Connection statements Feature Diagram . 74 A.19 SQL Session statements Feature Diagram . 75 A.20 SQL Dynamic Statements Feature Diagram . 76 A.21 SQL Diagnostic Statements Feature Diagram . 76 A.22 Scalar Expressions Feature Diagram . 77 A.23 Data Type Feature Diagram . 78 A.24 Window Function Feature Diagram . 79 A.25 Function Specification Feature Diagram . 80 A.26 Search Cycle Clause Feature Diagram . 81 A.27 Table Reference Feature Diagram . 82 A.28 Group By Clause Feature Diagram . 83 A.29 Window Clause Feature Diagram . 84 A.30 Predicate Feature Diagram . 85 LIST OF TABLES ix List of Tables B.1 Number of Features enlisted in the SQL:2003 Specification Draft . 86 B.2 SQL/JRT features . 87 B.3 SQL/OLB features . 87 B.4 SQL/PSM features . 88 B.5 SQL/MED features . 89 B.6 SQL/XML features . 90 C.1 SQL Platform Support -1 . 91 C.2 SQL Platform Support -2 . 92 x List of Abbreviations AHEAD Algebraic Hierarchical Equations for Application Design BNF Backus Naur form CLI Call Level Interface DSL Domain Specific Language FOD Feature-Oriented Decomposition FODA Feature-Oriented Domain Analysis FOP Feature-Oriented Programming FOR Feature-Oriented Refactoring FOSD Feature-Oriented Software Development JTS Jakarta Tool Suite JRT Routines and Types for Java Programming Language MED Management of External Data MBSE Model Based Software Engineering OLB Object Level Bindings PSM Persistent Stored Modules SPL Software Product Line SPLE Software Production Line Engineering SQL Structured Query Language Chapter 1. Introduction 1 Chapter 1 Introduction 1.1 Motivation Databases have come up a long way since Codd's concept of relational data model in 1970, now posed as the most vital component in the status quo of information technology. Database technology is at the core of multitude of software applications such as business transaction applications of varying size, digital libraries, web applications like online banking and online shopping, scientific projects like the human genome mapping project and NASA's earth observation system, Enterprise Resource Planning (ERP) systems, data warehouses, business intelligence applications like data mining and Online Analytical Processing (OLAP), embedded systems for personal information management, etc. The basic structure of databases has evolved from the relational model to encompass other conceptual models like entity relationship model, object relation model, object role model1, etc. Databases are available now also in the form of semi structured databases, object-oriented databases, multi-dimensional databases, distributed and parallel databases, etc. It can be argued that database technology will continue to evolve at an alarming rate as it makes foray into new domains with new domain specific techniques being invented and merged into current database technology. It has been observed that most popular database vendors tend to provide bits and pieces of support to every other kind of database functionality, be it indexes or XML support or special kinds of queries, etc [CW00]. Many small database vendors, which are large in number, cater only to a specific type of database technology, but large companies inevitably offer a jumble of features packed in one product. In a way, features of database products have been treated as a sales and marketing issue by big players without much consideration to how bloated such a product becomes for simplest of database applications. Every new release of the database product comes with the tag `Feature Rich', claiming to be better than competitors. Ironically, any enterprise of modest size makes use of only a tiny bit of mam- moth functionality provided by database products. This tends to be low-end features [CW00]. Most of the high-end features are rarely or never used. On one hand, it's good to have a large array of features that could give enhanced performance and 1http://www.orm.net/ 2 1.1. Motivation other advantages, on the other hand one can also say that database products are overloaded with features [CW00]. Database vendors have `learned' to adopt a one size fits all approach and maintain a single code line with all database management services they provide, reasons for which Stonebraker et al. [SC05] identify as maintenance and compatibility cost of code base and sales and marketing problems. They conclude that this is no more applicable and that \the commercial world (of databases) will fracture into a collection of independent database engines, some of which may be unified by a common front-end parser". Like databases which are getting caught in the universality trap [CW00], the structured query language (SQL) which is the basis for interaction between database technology and its user, has grown enormously.