1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen 2002-2008 Organization of Large Database Applications.

Slides:



Advertisements
Similar presentations
Lecture 6: Software Design (Part I)
Advertisements

Data Structures.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
•7/12 /07 F-1 © 2010 T. Horton CS 4240 Principles of SW Design Packages in Java and UML.
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Natural Joins These slides are licensed.
Inheritance Inheritance Reserved word protected Reserved word super
Regression Part II One-factor ANOVA Another dummy variable coding scheme Contrasts Multiple comparisons Interactions.
Encapsulation. Encapsulation Encapsulation means the bringing together of a set of attributes and methods into an object definition and hiding their implementational.
Copyright W. Howden1 Lecture 7: Functional and OO Design Descriptions.
Architecture is More Than Just Meeting Requirements Ron Olaski SE510 Fall 2003.
Copyright W. Howden1 Lecture 6: Design Evaluation and Intro to OO Design Patterns.
3 Copyright © 2004, Oracle. All rights reserved. Creating Packages.
CSCI 150 Database Applications Chapter 1 – Getting Started.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
Creating Packages. 2 home back first prev next last What Will I Learn? Describe the reasons for using a package Describe the two components of a package:
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
CS 255: Database System Principles slides: Variable length data and record By:- Arunesh Joshi( 107) Id: Cs257_107_ch13_13.7.
Computer Science 240 Principles of Software Design.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
CS 8532: Adv. Software Eng. – Spring 2007 Dr. Hisham Haddad Tuesday Class will start momentarily. Please Stand By … CS 8532: Advanced Software.
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
C++ Object Oriented 1. Class and Object The main purpose of C++ programming is to add object orientation to the C programming language and classes are.
Introduction to Object-oriented programming and software development Lecture 1.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Object Oriented Programming CS160 - OOP. Objects Objects are a Objects are a way to organize and conceptualize a program as a set of interacting objects.
Database Security John Ortiz. Lecture 23Database Security2 Secure Passwords  Two main requirements for choosing a secure password:  1) MUST be easy.
CS 3610: Software Engineering – Spring 2009 Dr. Hisham Haddad – CSIS Dept. Class Project OO Design Document Here is what you need to do for your class.
1 © Dennis Hart 2001 OOAD Packages, Dependencies & Interfaces Dr Dennis Hart.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Copyright ©2005  Department of Computer & Information Science Switch Statements.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
1 21 COP 3540 Data Structures with OOP Overview: Chapter 1.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen :1 Relationships These slides are licensed.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Introduction to Relational Databases &
Lecture 7: Requirements Engineering
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Union Subclasses & Disjoint 1:M Relationships.
Systems Analysis and Design in a Changing World, 3rd Edition
Regression Part II One-factor ANOVA Another dummy variable coding scheme Contrasts Multiple comparisons Interactions.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Maintaining Session State in the Data.
Lecture PowerPoint Slides Basic Practice of Statistics 7 th Edition.
What is a Package? A package is an Oracle object, which holds other objects within it. Objects commonly held within a package are procedures, functions,
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Maintaining Session State in the Data.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Slides for “Data Mining” by I. H. Witten and E. Frank.
UML Package Diagrams. Package Diagrams UML Package Diagrams are often used to show the contents of components, which are often packages in the Java sense.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Subqueries These slides are licensed under.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
Texas State Technical College DISCOVER! Modeling the Real World Its all about perspective.
1 Introduction to Design. 2 Outline Basics of design Design approaches.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Relational State Assertions These slides.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
4.1 THE INTERNATIONAL SYSTEM. The term international system is a metrical concept that facilitates a clear formulation of the main variables with which.
JAVA By Waqas.
Chapter 11 Object-Oriented Design
11.1 The Concept of Abstraction
The Object Oriented Approach to Design
Object-oriented programming principles
Creating and Using Classes
Inheritance Basics Programming with Inheritance
Computer Programming with JAVA
Problem Solving Skill Area 305.1
Business Analysis More on Classes Chris Russell O2.41
CS 8532: Advanced Software Engineering
Design Yaodong Bi.
Copyright © Ellis Cohen
C++ Object Oriented 1.
Presentation transcript:

1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Organization of Large Database Applications These slides are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. For more information on how you may use them, please see

2 © Ellis Cohen Overview of Lecture Subsystems Subsystem Design Problems Subsystems & Information Hiding Database-Oriented Subsystems

3 © Ellis Cohen Subsystems

4 © Ellis Cohen Subsystems Subsystem Name ~ visible data - private data ~ visible data ~ visible operation - private operation ~ visible operation Subsystems contain operations and data some of which are public/visible (outside of the subsystem) and some of which are private (to the subsystem)

5 © Ellis Cohen Subsystem Dependencies Subsystems have dependencies on other subsystems (shown as dashed lines) if they use their data or operations. It is preferable that there be no cycles in the dependency graph. A  subsystem operation may use any operation or data of its own, as well as the visible/public operations or data of any of its dependent children. Each piece of data is assigned to EXACTLY ONE subsystem

6 © Ellis Cohen Nested Subsystems Parent Subsystem Child Subsytems A subsystem may itself be so large, that it may need to be divided into child subsystems An operation of a parent system may use any operation or data of its own, as well as the visible/public operations of any of its nested children.

7 © Ellis Cohen Nested Subsystem Visibility A parent subsystem provides encapsulated functionality to other subsystems. Visible (~) components are only visible within the parent subsytem Public (+) components are also visible outside the parent subsystem Parent Subsystem + ~ + ~ ~ visible + public Child Subsytems

8 © Ellis Cohen Subsystem Design Problems

9 © Ellis Cohen Subsystem Design Problem 1 You are given a system S with data D1 and D2. The public operations and the data each one uses are op1: D1,D2 op2: D1,D2 op3: D1,D2 op4: D1,D2 op5: D1,D2 op6: D1,D2 op7: D1,D2 op8: D1,D2 op9: D1,D2 op10: D1,D2 Organize this into subsystems

10 © Ellis Cohen Subsystem Design Solution 1 S -D1 -D2 + op1 + op2 + op3 + op4 + op5 + op6 + op7 + op8 + op9 + op10 There just needs to be a single subsystem with D1 and D2, since no operations uses just one of them D1 and D2 can both be private, since there are no operations outside the subsystems that use them

11 © Ellis Cohen Subsystem Design Problem 2 You are given a system S with data D1 and D2. The public operations and the data each one uses are op1: D1 op2: D2 op3: D1 op4: D1 op5: D1 op6: D1 op7: D2 op8: D2 op9: D2 op10: D1 Organize this into subsystems

12 © Ellis Cohen Subsystem Design Solution 2 S1 - D1 + op1 + op3 + op4 + op5 + op6 + op10 - D2 + op2 + op7 + op8 + op9 S2 Separate the system into S1 (around D1) and S2 (around D2) because there are no operations that use both D1 and D2 D1 and D2 can both be private, since there are no operations outside of their respective subsystems that use them S

13 © Ellis Cohen Subsystem Design Problem 3 You are given a system S with data D1 and D2. The public operations and the data each one uses are op1: D1 op2: D1,D2 op3: D1,D2 op4: D2 op5: D1,D2 op6: D1 op7: D1,D2 op8: D1,D2 op9: D1,D2 op10: D1,D2 Organize this into subsystems

14 © Ellis Cohen Subsystem Design Solution 3a S1 ~ D1 + op1 + op6 ~ D2 + op4 S2 S12 + op2 + op3 + op5 + op7 + op8 + op9 + op10 S There are a few operations that use just D1 or just D2, so it is not clear whether it is worth defining S1 and S2 for so few operations

15 © Ellis Cohen Subsystem Design Solution 3b S1 ~ D1 + op1 + op6 ~ D2 + op4 S2 S + op2 + op3 + op5 + op7 + op8 + op9 + op10 No need to place the operations that need both D1 and D2 is a separate subsystem. Operations in a parent system can use the visible/public date/operations of its children

16 © Ellis Cohen Subsystem Design Solution 3c S -D1 -D2 + op1 + op2 + op3 + op4 + op5 + op6 + op7 + op8 + op9 + op10 There are a few operations that use just D1 or just D2, but the bulk of the operations use both of them, so there may not be enough to be gained from separating them to offset the cost of defining two additional subsystems. However, this solution is not as good from an information hiding or security perspective

17 © Ellis Cohen Subsystem Design Problem 4 You are given a system S with data D1, D2 and D3. The public operations and the data each one uses are op1: D1, D2 op2: D2, D3 op3: D1, D2 op4: D1, D2 op5: D1, D2 op6: D2, D3 op7: D2, D3 op8: D2, D3 op9: D1, D2 op10: D1, D2 Organize this into subsystems

18 © Ellis Cohen Subsystem Design Solution 4 S2 ~ D2 You want one developer to only have to deal with D1 (and, of course its interactions with D2), and a separate developer to only have to deal with D3 (and its interactions with D2). S2 is needed because a piece of data can only be assigned to one subsystem. Also, you may want to assign a developer to "own" D2 and interact with the developers of S12 and S23. -D1 + op1 + op3 + op4 + op5 + op9 + op10 S12 -D3 + op2 + op6 + op7 + op8 S23 S

19 © Ellis Cohen Subsystem Design Problem 5 You are given a system with data D1 and D2. The public operations and the data each one uses are op1: D2 op2: D2 op3: D1, D2 op4: D1 op5: D1 op6: D1 op7: D2 op8: D2 op9: D2 op10: D1 Organize this into subsystems

20 © Ellis Cohen Subsystem Design Solution 5a S1 ~ D1 + op4 + op5 + op6 + op10 ~ D2 + op1 + op2 + op7 + op8 + op9 S2 It is worth dividing the system into S1 and S2 since there are a significant number of operations that just use D1 or just use D2. But S12 depends on both S1 and S2, since it uses D1 from S1 and D2 from S2. Both D1 and D2 need to be visible, since they are used by S12. S +op3

21 © Ellis Cohen Subsystem Design Solution 5b ~ D2 + op1 + op2 + op7 + op8 + op9 S2 S2 contains the operations which only depend upon D2. S not only contains the operations which only depend upon D1, but also op3, which uses D2. D2 must be visible, since op3 uses it. This solution is only reasonable if there a more general reason why S needs to know about S2 – one good reason is that D1 has a reference to data in D2 S - D1 + op3 + op4 + op5 + op6 + op10

22 © Ellis Cohen Subsystem Organization Goals Cohesive Most tables in the subsystem should be used by most of the operations of the subsystem. Independent Most tables an operation needs should be part of the same subsystem. This principles argues against making subsystems too large. Acyclic Avoid cycles in the subsystem graph. –Sometimes cycles can be fixed by reorganizing subsystems. –Sometimes you must also change your relational model. A good design balances these goals

23 © Ellis Cohen Subsystems & Information Hiding

24 © Ellis Cohen Information Hiding It sometimes can be useful to hide visible data by instead making functionality available through visible (but not public) operations. Suppose op3 actually computes f1(D1) + f2(D2) Redesign the subsystems

25 © Ellis Cohen Subsystem Design Solution 5a S1 - D1 + op4 + op5 + op6 + op10 ~ f1 - D2 + op1 + op2 + op7 + op8 + op9 ~ f2 S2 S +op3 D1 and D2 can now be made private, since they are not needed directly outside of their respective subsystems. op3 can get the needed information by calling f1 and f2, which are visible (but not public) operations

26 © Ellis Cohen D1 + op3 + op4 + op5 + op6 + op10 - f1 Subsystem Design Solution 5b - D2 + op1 + op2 + op7 + op8 + op9 ~ f2 S2 S D2 can be made private, since it is not needed directly outside of its subsystems. f2 is visible in S2, since op3 needs to call it.

27 © Ellis Cohen Subsystem Design Solution 5b' S12 - D1 + op3 + op4 + op5 + op6 + op10 - f1 - D2 + op1 + op2 + op7 + op8 + op9 ~ f2 S2 D1 and D2 can be made private, since they are not needed directly outside of their respective subsystems. f2 is visible in S2, since op3 in S12 needs to call it. But f1 can now be private in S1, since op3 is in f1 as well

28 © Ellis Cohen Database-Oriented Subsystems

29 © Ellis Cohen Database-Oriented Subsystems Database Applications can be organized into subsystems as well, following the same principles –The data of a database subsystem can include tables and views (and package variables) –Operations include procedures, functions and cursors, which can be organized into one or more packages

30 © Ellis Cohen Subsystems & Packages Subsystem Name ~ visible tables - private tables ~ visible tables ~ visible operation - private operation ~ visible operation Package ~ visible variables - private variables ~ visible views - private views

31 © Ellis Cohen View-Based Encapsulation In databases, views & cursors play the most significant encapsulation role. A subsystem can keep a table (e.g. T) private by making a cursor or view (e.g. V) visible. Changes can then be made to the underlying table representation (and to the view definition), but other subsystems that use the view will not need to be changed - T + V

32 © Ellis Cohen Enforcing Information Hiding It is possible to enforce information hiding by –using a separate schema for each subsystem –granting privileges (SELECT for the views, and EXECUTE for the packages) to the other subsystem schemas that depend on it Even without enforcement, a subsystem organization enhances maintainability