Object-Role Modeling Fundamentals
Total Page:16
File Type:pdf, Size:1020Kb
Object-Role Modeling Fundamentals A Practical Guide to Data Modeling with ORM i Object-Role Modeling Fundamentals A Practical Guide to Data Modeling with ORM Terry Halpin INTI International University Technics Publications New Jersey Published by: 2 Lindsley Road Basking Ridge, NJ 07920 USA http://www.TechnicsPub.com Cover design by Mark Brye All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage and retrieval system, without written permission from the publisher, except for the inclusion of brief quotations in a review. The author and publisher have taken care in the preparation of this book, but make no expressed or im- plied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. All trademarks are property of their respective owners and should be treated as such. Copyright © 2015 by Terry Halpin ISBN, print ed. 9781634620741 ISBN, Kindle ed. 9781634620758 ISBN, ePub ed. 9781634620765 First Printing 2015 Library of Congress Control Number: 2015935403 Contents Foreword by Serge Valera Preface 1 Overview of Object-Role Modeling ............................................. 1 1.1 Information Modeling ................................................................................................... 1 1.2 Fact-Based Modeling ..................................................................................................... 4 1.3 The Conceptual Schema Design Procedure ...................................................... 13 1.4 Fact-Based Modeling Tools ..................................................................................... 17 1.5 NORMA Lab 1 ................................................................................................................. 19 2 CSDP Steps 1–5 ......................................................................... 37 2.1 CSDP Steps 1–3 ............................................................................................................. 37 2.2 CSDP Step 4..................................................................................................................... 45 2.3 CSDP Step 5..................................................................................................................... 54 2.4 Objectification ............................................................................................................... 60 2.5 NORMA Lab 2 ................................................................................................................. 63 3 CSDP Step 6 .............................................................................. 81 3.1 Value Constraints ......................................................................................................... 81 3.2 Set-Comparison Constraints ................................................................................... 84 3.3 Subtyping ......................................................................................................................... 92 3.4 NORMA Lab 3 ............................................................................................................... 105 4 CSDP Step 7 ............................................................................ 119 4.1 Frequency Constraints ............................................................................................ 120 4.2 Ring Constraints ......................................................................................................... 123 4.3 Value-Comparison Constraints ............................................................................ 138 4.4 Other Constraints and Final Checks .................................................................. 141 4.5 NORMA Lab 4 ............................................................................................................... 147 v vi Contents Appendix A: Generating SQL Code .................................................157 Appendix B: ORM Symbol Glossary ................................................165 Appendix C: Further Resources ......................................................175 Index .............................................................................................177 Foreword Serge Valera Senior Software Engineer, System, Software and In-Orbit Demonstration Department European Space Agency Developing and operating space systems entails complex activities involving many partners, distributed in location and time. This requires efficient and effective exchanges of information between all partners involved. Years of work developing centralized information systems re- vealed the complexity of such development, often resulting in inadequate and inefficient products that fail to satisfy all the needs. Years of work building distributed information sys- tems by reusing (and adapting) "proprietary" systems also revealed that such approaches of- ten suffer from loss of semantics in the resulting data exchange. These deficiencies always have the same source: the difficulty for the customers to fully and adequately specify their needs and to validate the resulting system requirements specifica- tions prior to contracting the development of the required products. Most information modelling approaches used in industry today are technology driven ra- ther than adequately addressing the customer’s needs. By focusing on the structuring of the information in terms of data items according to the required storage and access performances, such approaches provide little emphasis on the semantics. The Object-Role Modelling (ORM) methodology introduced in this book addresses infor- mation modelling from the customers' viewpoint, the WHAT. This approach focuses on captur- ing all stakeholders' information requirements in a conceptual model that can be expressed as system requirements specifications, i.e. the contractual language, for the purpose of being val- idated by these stakeholders prior to any contract agreement. ORM is a Fact Based Modelling (FBM) methodology in which all facts are modelled as rela- tionships (unary, binary, ternary, etc.). How facts are grouped into structures is an implemen- tation issue that is out of scope for the customer. This results in greater semantic stability for any contractual business. By capturing information in terms of atomic facts, ORM expresses the information requirements in the simplest possible way. vii viii Foreword At ESA since the late 1980s, I searched for a means to fully and formally specify the WHAT, i.e. applying the Conceptualization and 100% Principle of ISO TR9007. I discovered fact based modelling in the early 90’s and successfully used ORM to develop in-house information sys- tems, and to conceptualize situations for the purpose of verifying and validating the adequacy of related industrial developments. In 2006, I met with Terry and others in the FBM research community, and have been col- laborating with them ever since. Today, at the European Space Agency we have the technology to develop any information system as a stand-alone product. The use of FBM and ORM in the specification of these systems reduces the risk of expensive developments due to lack of un- derstanding the stakeholders' needs. What is missing in the European Space Business and more generally in all large products development involving many industrial and agencies partners is the adequate means to ad- dress the interoperability, i.e. the means to address interoperability at a semantic level. Thanks to Terry's constant willingness to share his knowledge, to transfer his many years of research and knowhow to ESA, we are now facing a new evolution in the Software business that is "from Product Modelling to Enterprise Modelling", "from semantic modelling to seman- tic interoperability". Enabling semantic interoperability requires semantic modelling of the products involved, using a modelling approach such as FBM/ORM to fully and precisely capture the relevant se- mantics. This raises the question of how to best train industrial practitioners in ORM. Previously published books on ORM have provided an in-depth and broad coverage of mul- tiple information systems modelling approaches, including formal discussion of the logical foundations of ORM, or instead have focused on use of a specific ORM modelling tool. In con- trast, Terry’s new book is mainly aimed at practitioners, providing a simple and short intro- duction to the key aspects of ORM and explaining how it can be used in practice to develop information systems. Transferring academic knowledge to industry has always been a difficult task. Industry needs to estimate the maturity of the research technology, the industrial work needed to de- velop operational solutions, and the value of the resulting solutions to positively impact the business. This technology readiness level assessment is on-going in the European space busi- ness. Terry's new book will play an important role in this assessment. Together with the NORMA freeware tool discussed in the book, it offers newcomers a way to discover the benefit of conceptual modelling with ORM by applying that methodology for example to the develop- ment of new information systems or to facilitate the process of validating the adequacy of ex- isting or under-development systems, resulting in a reduction