1 Copyright 8 2002 Flying Kiwi Productions Inc. Chapter 4 Data-Oriented Models l 4.1. Data Models: The ERD l 4.2. Paradigm Shift l 4.3.

Slides:



Advertisements
Similar presentations
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Advertisements

Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Introduction To System Analysis and Design
Client/Server Databases and the Oracle 10g Relational Database
From Class Diagrams to Databases. So far we have considered “objects” Objects have attributes Objects have operations Attributes are the things you record.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 7 Using Data Flow Diagrams
Entity-Relationship Model and Diagrams (continued)
Chapter 9 Using Data Flow Diagrams
A Quick Review of Analysis Stages of the Systems Development Life Cycle Planning Analysis Design Construction.
Chapter 1 Program Design
Database Design Concepts Lecture 7 Introduction to E:R Modelling Identifying Entities.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
DATA FLOW DIAGRAMS IT 155.
APPENDIX C DESIGNING DATABASES
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
Practical tips for creating entity relationship diagrams (ERDs) Chitu Okoli Associate Professor in Business Technology Management John Molson School of.
Chapter 5: Modeling Systems Requirements: Events and Things
Modeling Systems Requirements: Events and Things.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data Modeling using Entity Relationship Diagramming (ERD)
CMIS 470 Structured Systems Design
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Systems Analysis and Design in a Changing World, Fifth Edition
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
Web-Enabled Decision Support Systems
Chapter 7 Using Data Flow Diagrams
5 Systems Analysis and Design in a Changing World, Fourth Edition.
1 Copyright Flying Kiwi Productions Inc. An Introduction to Object-Oriented Analysis Objects and UML in plain English. Chapter.
Introduction To System Analysis and Design
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Systems Analysis & Design 7 th Edition Chapter 5.
1. Objectives At the end of this chapter you should be able to:  Discuss the use and features of a data model  Define the terms entity and attribute.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Systems Analysis and Design in a Changing World, 6th Edition
1 Copyright Flying Kiwi Productions Inc. An Introduction to Object-Oriented Analysis Objects and UML in plain English. Chapter.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Sight Words.
Lecture 91 Introduction to Data Analysis and Logic Specification Objectives l Draw an entity-relationship diagram, and explain the types of entity relationships.
DBMS ER model-2 Week 6-7.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Lecture 8&9 11/2/16 Introduction to OO Concepts 1.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
WELCOME TO OUR PRESENTATION UNIFIED MODELING LANGUAGE (UML)
CHAPTER 6 OBJECT ANALYSIS.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Introduction to OOAD and UML
5 Systems Analysis and Design in a Changing World, Fourth Edition.
5 Chapter 5: Modeling Systems Requirements: Events and Things Systems Analysis and Design in a Changing World.
Some Simple Design Modeling Techniques
Object-Oriented Analysis and Design
Lecture on Data Modeling and Analysis
Database Design Using the REA Data Model
Chapter 4 Data-Oriented Models
Database Fundamentals
IT 244 Database Management System
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

1 Copyright Flying Kiwi Productions Inc. Chapter 4 Data-Oriented Models l 4.1. Data Models: The ERD l 4.2. Paradigm Shift l 4.3. Entity-Relationship Modeling l 4.4. Object-Oriented Models l 4.5. An Introduction to Objects l 4.6. Object-Oriented vs Object-Based l 4.7. Conceptual, Logical & Physical Models l 4.8. Models as Communication Tools

2 Copyright Flying Kiwi Productions Inc Data Models: The ERD l Research to find ways to model data l To give template for database design l Many notations were tried l Chen (1976) proposed the Entity-Relationship Diagram (ERD) l l Mid-1970s: Databases were just coming into use

3 Copyright Flying Kiwi Productions Inc. DATAand How it is Linked and Organized. It was from this that objects then evolved. The ERD was the first systems analysis tool to focus on

4 Copyright Flying Kiwi Productions Inc. n The Entity-Relationship Principle, and n The Entity-Relationship Notation. l These further issues were also investigated by Chen and others: n E-R models for database design n The significance of the data of an enterprise n Data as a corporate asset. n The stability of the data of an enterprise 4.1. Data Models: The ERD Chen made two contributions :

5 Copyright Flying Kiwi Productions Inc Paradigm Shift A paradigm shift is a major change in the way we think about something. True paradigm shifts are rare. (Brooks, 1976)

6 Copyright Flying Kiwi Productions Inc Paradigm Shift l Chemistry: Alchemy  Atoms. l Astronomy: “Bible”  Galileo. “Bible” = Geocentric, as interpreted by Inquisition l Biology: Creation  Darwin. Each of these was a major change in how we viewed our world. l l Physics: Newton  Einstein.

7 Copyright Flying Kiwi Productions Inc Paradigm Shift a pattern or mode of thinking and believing that serves to organize the way we approach knowledge, learning and understanding. l A paradigm shift occurs when we adopt a radically different way of organizing all or part of our worldview. l paradigm l A paradigm is

8 Copyright Flying Kiwi Productions Inc. l While Objects are an evolution from Entities, the change is so dramatic and far-reaching... that it also qualifies as a true paradigm shift Paradigm Shift l Two Paradigm Shift in IT industry: 1. Process-oriented  Data-oriented 2. Data-oriented  Object-oriented

9 Copyright Flying Kiwi Productions Inc Entity-Relationship Modeling As we saw earlier, Chen made two main contributions, the ERD Principle and ERD Notation, as well as investigating several other issues.

10 Copyright Flying Kiwi Productions Inc. The following six points all relate to both E-R and Object modeling. Now let’s examine them in this order:   The Entity-Relationship Principle.   E-R models for database design.   The stability of data.   The significance of data.   Data as a corporate asset.   Entity-Relationship Notation.

11 Copyright Flying Kiwi Productions Inc. The Entity-Relationship Principle.   The Entity-Relationship Principle. Sales l l Customers l l Products l l Sales l l Sales clerks l To manage a sales operation, we need to keep data about :

12 Copyright Flying Kiwi Productions Inc. Phone l l Customers l l Numbers l l Lines l l Calls l l Services The Entity-Relationship Principle.   The Entity-Relationship Principle. l To run a phone company, we would need to keep data about:

13 Copyright Flying Kiwi Productions Inc. The Entity-Relationship Principle.   The Entity-Relationship Principle. l booking agency l To run a booking agency we must record information about: Booking s Venues s Artists s Agents s Concerts s Performances s Customers s Seats

14 Copyright Flying Kiwi Productions Inc. Booking l l Venues l l Artists l l Agents l l Concerts l l Performances l l Customers l l Seats The Entity-Relationship Principle.   The Entity-Relationship Principle. booking agency To run a booking agency we must record information about: Notice there is no Date in this list. Notice there is no Date in this list. Why Not?

15 Copyright Flying Kiwi Productions Inc. A date can describe many things A date can describe many things l The key word here is Things The Entity-Relationship Principle.   The Entity-Relationship Principle. A date is data that describes a Concert A date is data that describes a Concert

16 Copyright Flying Kiwi Productions Inc. Each of these lists is a list of things Phone Phone l Customers l Numbers l Lines l Calls l Services Booking l Venues l Artists l Agents l Concerts l Performances l Customers l Seats Sales Sales l Customers l Products l Sales clerks The Entity-Relationship Principle.   The Entity-Relationship Principle.

17 Copyright Flying Kiwi Productions Inc. Earlier methods emphasized what the users need to know to do their job. Earlier methods emphasized what the users need to know to do their job. Here we emphasize what things the users need to know about. Here we emphasize what things the users need to know about. The word Entity means a thing. The word Entity means a thing. Later we worry about what items they need to know about each entity. Later we worry about what items they need to know about each entity. The Entity-Relationship Principle.   The Entity-Relationship Principle. The E-R principle focuses on the things we need to keep data about. The E-R principle focuses on the things we need to keep data about.

18 Copyright Flying Kiwi Productions Inc. l You can see it is something we need to know about (i.e., keep data about) to do our job l So we define it... The Entity-Relationship Principle.   The Entity-Relationship Principle. l Webster: An entity is “something that has separate and distinct existence”

19 Copyright Flying Kiwi Productions Inc. A Data Entity is some thing that has separate and distinct existence in the world of the users and is of interest to the users in that they need to keep data about it in order to do their job. The Entity-Relationship Principle.   The Entity-Relationship Principle.

20 Copyright Flying Kiwi Productions Inc. So these are the entity lists for these businesses: Phone Phone l Customers l Numbers l Lines l Calls l Services Booking l Venues l Artists l Agents l Concerts l Performances l Customers l Seats Sales Sales l Customers l Products l Sales clerks The Entity-Relationship Principle.   The Entity-Relationship Principle.

21 Copyright Flying Kiwi Productions Inc. What we need to talk about mostly is the class of all Customers, or in other words the type of thing called a Customer. What we need to talk about mostly is the class of all Customers, or in other words the type of thing called a Customer. The Entity-Relationship Principle.   The Entity-Relationship Principle. Grammatically, the term Entity refers to a single specific Customer or Product or Sale or Call or Artist. Grammatically, the term Entity refers to a single specific Customer or Product or Sale or Call or Artist.

22 Copyright Flying Kiwi Productions Inc. The Entity-Relationship Principle.   The Entity-Relationship Principle. An is a class or category expressing the common properties that allow a number of entities to be treated similarly. So we define: Entity Type

23 Copyright Flying Kiwi Productions Inc. l Entity types are always singular. l So our entity lists look like this: All Singular Phone Phone l l Customer l l Number l l Line l l Call l l Service Booking l l Venue l l Artist l l Agent l l Concert l l Performance l l Customer l l Seat Sales Sales l l Customer l l Product l l Sales clerk The Entity-Relationship Principle.   The Entity-Relationship Principle.

24 Copyright Flying Kiwi Productions Inc. An individual Customer or Product or Sale or Call or Artist is then an Occurrence of the Entity Type. The Entity-Relationship Principle.   The Entity-Relationship Principle.

25 Copyright Flying Kiwi Productions Inc. l I am an occurrence of the entity type “Employee” l You are an occurrence of the entity type “Student” l We each live in an occurrence of the entity type “Dwelling” l The last time you caught an occurrence of the entity type “Bus,” it followed an occurrence of the entity type “Route” while executing an occurrence of the entity type “Trip.” The Entity-Relationship Principle.   The Entity-Relationship Principle.

26 Copyright Flying Kiwi Productions Inc. Attributes are the data elements carried by an entity that describe it and record its state. Attributes are the data elements carried by an entity that describe it and record its state. Attributes are the things we need to know about an Entity. Attributes are the things we need to know about an Entity. The Entity-Relationship Principle.   The Entity-Relationship Principle.

27 Copyright Flying Kiwi Productions Inc. So how did the Country occurrence Canada happen to get the string value “Canada” as the value for its Name attribute? The Entity-Relationship Principle.   The Entity-Relationship Principle.

28 Copyright Flying Kiwi Productions Inc. On the day of Canada’s confederation, the Founding Fathers placed 26 slips of paper in a hat with the 26 letters of the alphabet on them. “Just draw 3 letters,” they said, “We want a short, crisp name for our beautiful new country.” So the one with the hat did as directed, and announced: “C, eh ?” “N, eh ?” “D, eh ?” The Entity-Relationship Principle.   The Entity-Relationship Principle.

29 Copyright Flying Kiwi Productions Inc.  The Entity-Relationship Principle. Associations: l So we have:  Hundreds of Customers  Thousands of Products  Dozens of Sales Clerks l Do we have a business? NOT YET!

30 Copyright Flying Kiwi Productions Inc. Not until: A Customer buys a Product A Customer buys a Product  A Sales Clerk sells a Product  A Sales Clerk sells to a Customer These are the inter actions These are the inter actions that occur between entities. Note each involves a verb. Note each involves a verb.  The Entity-Relationship Principle. Associations:

31 Copyright Flying Kiwi Productions Inc. We define: An Association is the interaction of two entities and is represented by a verb.  The Entity-Relationship Principle. Associations:

32 Copyright Flying Kiwi Productions Inc. l The purpose is to provide access paths to the data. l When a sale occurs, we will link: A Customer To a Product To a Sales Clerk. Using a verb to describe each link. Using a verb to describe each link.  The Entity-Relationship Principle. Associations :

33 Copyright Flying Kiwi Productions Inc. l Note we have not made any mention of inputs or outputs, l And we have touched on business processes, but only as they concern the data.  The Entity-Relationship Principle. Associations:

34 Copyright Flying Kiwi Productions Inc. In this way we are able to diagram the structure of our user’s business data, independent of any way that the data may be used, either now or in the future.  The Entity-Relationship Principle. Associations:

35 Copyright Flying Kiwi Productions Inc. Principle SUMMARY  The Entity-Relationship Principle SUMMARY An Entity is a thing the users need to know (i.e, record) something about. An Entity is a thing the users need to know (i.e, record) something about. An Entity Type is a group or class of entities that are all the same kind of thing. An Entity Type is a group or class of entities that are all the same kind of thing. An Occurrence of an Entity Type is a specific individual thing of the kind the Entity Type describes. An Occurrence of an Entity Type is a specific individual thing of the kind the Entity Type describes. Attributes are the things we need to know about an Entity. Attributes are the things we need to know about an Entity. An Association is the interaction of two Entities and is represented by a verb. An Association is the interaction of two Entities and is represented by a verb. These interactions among the Entities (i.e., these associations ) show us the pathways we need to follow through the database to access the data. These interactions among the Entities (i.e., these associations ) show us the pathways we need to follow through the database to access the data.

36 Copyright Flying Kiwi Productions Inc. E-R models for database design.   E-R models for database design. There is a very significant reason why Entities, Attributes and Associations are so fundamentally important for systems development.

37 Copyright Flying Kiwi Productions Inc. To start with, the search for data modeling methods was for database design. To start with, the search for data modeling methods was for database design. l Many notations were developed and some actually tried out. Chen’s ERD turned out best and took over. Chen’s ERD turned out best and took over. It also caught on as a tool for systems analysis, as well as for data analysis. It also caught on as a tool for systems analysis, as well as for data analysis. E-R models for database design.   E-R models for database design.

38 Copyright Flying Kiwi Productions Inc. For database design: l Each Entity becomes a file or table. l Each Attribute becomes a field (i.e., a column) l Each Association becomes an access pathway (i.e., a foreign key) E-R models for database design.   E-R models for database design.

39 Copyright Flying Kiwi Productions Inc. Stability   The Stability of Data. l This year, our favorite Transit Company is concerned with entity types: Bus, Driver, Route, Trip, Bus Stop and Passenger. l Ten years from now, there will be many changes in how the company is run, and in how the people do their jobs. l But they will still have to deal with Buses, Drivers, Routes, Trips, Bus Stops and Passengers ! l Not only that, but ten years ago they worked with Buses, Drivers, Routes, Trips, Bus Stops and Passengers !

40 Copyright Flying Kiwi Productions Inc. And a college registration system must deal with entity types Student, Course, Subject Area, Room, Instructor and Enrolment now, in the future, and in the past, “As it was in the beginning, is now, and forever shall be, data without end...” Stability   The Stability of Data.

41 Copyright Flying Kiwi Productions Inc. This tells us that Data Entities Are Stable Over Time. Stability   The Stability of Data.

42 Copyright Flying Kiwi Productions Inc. l When we organize our data around the entities from the real world of the user, Those entities are stable. Those entities are stable. Stability   The Stability of Data.

43 Copyright Flying Kiwi Productions Inc. l However, entities are neither static nor stagnant; l There may be an occasional new entity, l There will often be new attributes, l But as long as we stay in the same business there will be very few new entities. Stability   The Stability of Data.

44 Copyright Flying Kiwi Productions Inc. This stability contributes greatly to reducing the costs and delays in system maintenance. Stability   The Stability of Data.

45 Copyright Flying Kiwi Productions Inc. However, beware new business ! Mergers, acquisitions, takeovers and diversifications can all put your company into new businesses with a host of new entity types. Stability   The Stability of Data.

46 Copyright Flying Kiwi Productions Inc.   The Significance of Data. The Data modeler’s Creed: Data is the Centre of the Universe

47 Copyright Flying Kiwi Productions Inc. l Out of the universe of all data l Our project is concerned only with the subset l that belongs in the business area we are studying. l The ERD is the tool we have been using to study, document and understand this data.   The Significance of Data.

48 Copyright Flying Kiwi Productions Inc. l The structure of this data drives the design of the databases that must store it. l The databases in turn support the design of the programs, l That support the users’ operation by supplying exactly the data need, when they need it, in a form they can use, l And by accepting the data they generate as they do their jobs.   The Significance of Data.

49 Copyright Flying Kiwi Productions Inc. l All of this must be done in a transparent, user-friendly way, So that the software enhances the users’ performance. So that the software enhances the users’ performance. This, after all, is the only reason why the software should exist at all !   The Significance of Data.

50 Copyright Flying Kiwi Productions Inc. Corporate  Data as a Corporate Asset. Since the users both need and generate data as they work, it can be said that their operation rests upon this pool of data that must exist for them to function.

51 Copyright Flying Kiwi Productions Inc. l Since data is something the users must have in order to work, It can rightly be regarded as a Business Asset or Resource It can rightly be regarded as a Business Asset or Resource l Just like s Finance s Human Resources s Plant and Equipment s Vehicles s Inventories s Etc. Corporate  Data as a Corporate Asset.

52 Copyright Flying Kiwi Productions Inc. l Acquisition l Organizing, storing and safekeeping l Deployment, on time, to the people who need it l Disposal when no longer needed Corporate  Data as a Corporate Asset. Like any corporate asset, there are some basic functions that must be done as part of managing the asset:

53 Copyright Flying Kiwi Productions Inc. l This has led to two new functions in the information industry, s Data Administration (DA) and s Data Resource Management (DRM). l DA is a middle-management function concerned with finding and documenting every data element the company uses. l DRM is a high-level management function, involving long-term strategic planning. DRM reports to the CIO (Chief Information Officer; in a well-organized company the CIO is a vice-president). Corporate  Data as a Corporate Asset.

54 Copyright Flying Kiwi Productions Inc. l The focus of DA and DRM is to manage data as we would manage any other business resource. l Hitherto, the ERD has been the tool used to understand, document and administer data. l As of now, the Object Model is taking over this function. Corporate  Data as a Corporate Asset.

55 Copyright Flying Kiwi Productions Inc.   The Entity-Relationship Notation. l There are many E-R notations. l All of them work, any will do the job. l Use whichever one you or your boss or your professor or your client prefers. l UML is now the standard notation in the object world, so l We will use UML for our Entities as well as our Objects.

56 Copyright Flying Kiwi Productions Inc. l Draw an Entity as a square or rectangular box, divided by a line near the top. l Above the line place the name, singular. Notation. Entities   The Entity-Relationship Notation. Entities Student

57 Copyright Flying Kiwi Productions Inc. l If there are not too many, Attributes may go in the bottom part of the box. l Primary key first, marked with an asterisk. l If not enough room, show only the key, list the others in the accompanying write-up. Notation. Attributes   The Entity-Relationship Notation. Attributes Student *Student No. Name Age Sex

58 Copyright Flying Kiwi Productions Inc. l Draw a line joining two entity boxes to show a relationship exists l Write the verb above the line. Enrolls In   The Entity-Relationship Notation. Associations : Student *Student No. Name Age Sex Course Offering *Course No. *Date Room No. Max Enrol

59 Copyright Flying Kiwi Productions Inc.   The Entity-Relationship Notation. Associations Course Offering *Course No. *Date Room No. Max Enrol Add a solid arrowhead so that it makes a sentence when you read it in the direction of the arrow : Add a solid arrowhead so that it makes a sentence when you read it in the direction of the arrow : “Student enrols in course” “Student enrols in course” Enrolls In Student *Student No. Name Age Sex

60 Copyright Flying Kiwi Productions Inc.   The Entity-Relationship Notation. Associations Course Offering *Course No. *Date Room No. Max Enrol Student *Student No. Name Age Sex Instructor *Employee No. Name Age Sex Salary teaches Enrolls In

61 Copyright Flying Kiwi Productions Inc. Enrols In   The Entity-Relationship Notation. Associations Course Offering *Course No. *Date Room No. Max Enrol Student *Student No. Name Age Sex Instructor *Employee No. Name Age Sex Salary teaches College *Name Address Phone Rating Employs

62 Copyright Flying Kiwi Productions Inc.   The Entity-Relationship Notation. More Examples of Associations Customer *A/c No. Name Address Phone No. Balance Product *Prod No. Description Unit Price Qty in Stock buys Read the sentence in the direction of the arrow: “Customer buys Product.”

63 Copyright Flying Kiwi Productions Inc.   The Entity-Relationship Notation. More Examples of Associations Bus *Bus No. Make Model Seating Driver *Employee No. Name Wage Sex Customer *A/c No. Name Address Phone No. Balance Product *Prod No. Description Unit Price Qty in Stock Read the sentence in the direction of the arrow. drives “Customer buys Product” “Driver drives Bus” buys

64 Copyright Flying Kiwi Productions Inc. Q. When a driver drives a bus, how many does she drive? A. One, usually. But over time? Why, a whole bunch! Q. When a Customer buys a Product, how many does he buy? A. One per transaction, perhaps, but over time we hope he’ll buy a great many. Multiplicity   The Entity-Relationship Notation. Multiplicity

65 Copyright Flying Kiwi Productions Inc. l The critical thing we need to know is Is it One, or Is it Many ? This is the Multiplicity of the relationship (also called cardinality ). This is the Multiplicity of the relationship (also called cardinality ).   The Entity-Relationship Notation. Multiplicity

66 Copyright Flying Kiwi Productions Inc. Webster defines Cardinality as “The number of members in a set.” Webster defines Cardinality as “The number of members in a set.” For us, Multiplicity is the number of occurrences of each entity type that can be involved in an association. For us, Multiplicity is the number of occurrences of each entity type that can be involved in an association.   The Entity-Relationship Notation. Multiplicity

67 Copyright Flying Kiwi Productions Inc. l We diagram this by adding a star (asterisk) below the relationship line whenever it should show “many.” l Read this one as “Instructor teaches many course offerings”   The Entity-Relationship Notation. Multiplicity Course Offering *Course No. *Date Room No. Max Enrol Instructor *Employee No. Name Age Sex Salary teaches *

68 Copyright Flying Kiwi Productions Inc. l We refer to this as a “One-to-Many” Association, or 1:M Notation.   The Entity-Relationship Notation. Multiplicity Course Offering *Course No. *Date Room No. Max Enrol Instructor *Employee No. Name Age Sex Salary teaches *

69 Copyright Flying Kiwi Productions Inc. l Read the sentence in the direction of the arrow l Read the star (asterisk) as the word “ many.” Notation.   The Entity-Relationship Notation. Multiplicity Course Offering *Course No. *Date Room No. Max Enrol Instructor *Employee No. Name Age Sex Salary teaches *

70 Copyright Flying Kiwi Productions Inc. And, since we wish many Customers to buy many Products, And, since we wish many Customers to buy many Products, This one is a Many-to-Many association, or M:M This one is a Many-to-Many association, or M:M Notation.   The Entity-Relationship Notation. Multiplicity Customer *A/c No. Name Address Phone No. Balance Product *Prod No. Description Unit Price Qty in Stock buys * *

71 Copyright Flying Kiwi Productions Inc. l There are numerous other symbols also used for the “many” end of a relationship, l including single and double arrows, etc. l The star (asterisk) is the UML standard. l Other ERD notations have their own ways to show “many” and what direction to read the sentence. Notation.   The Entity-Relationship Notation. Multiplicity

72 Copyright Flying Kiwi Productions Inc. l There are many ERD notations. We are using UML since it has become the official world standard object notation. An entity is a square box, with a singular name above a horizontal line. An entity is a square box, with a singular name above a horizontal line. The primary key attribute is below the line, with an asterisk ( * ) The primary key attribute is below the line, with an asterisk ( * ) l Other attributes are listed below or on another page. ctd... Notation. Summary   The Entity-Relationship Notation. Summary

73 Copyright Flying Kiwi Productions Inc. An association is a line joining two entities. An association is a line joining two entities. Write the verb above the line, with arrowhead. Write the verb above the line, with arrowhead. Reading in the direction of the arrow, Reading in the direction of the arrow,entity-verb-entity should make a simple sentence. ctd... Notation. Summary   The Entity-Relationship Notation. Summary

74 Copyright Flying Kiwi Productions Inc. Multiplicity is one (straight line) or many (asterisk) below each end of the line. Multiplicity is one (straight line) or many (asterisk) below each end of the line. Notation. Summary   The Entity-Relationship Notation. Summary 1:M M:M * **

75 Copyright Flying Kiwi Productions Inc. There is one major side benefit to both ERDs and Object modeling.

76 Copyright Flying Kiwi Productions Inc. Both serve these four important functions: Allow us to understand the users’ business quickly and accurately Allow us to understand the users’ business quickly and accurately Document the information needs of the users’ business Document the information needs of the users’ business Give the DA the tool to understand, document and ultimately control the data Give the DA the tool to understand, document and ultimately control the data Give a template or pattern for database design. Give a template or pattern for database design. And they are more effective, and give us better insights and understanding, than any of the earlier methods.

77 Copyright Flying Kiwi Productions Inc Object-Oriented Models Object-Oriented Programming (OOP) is now the state of the art. Object-Oriented Programming (OOP) is now the state of the art. Pool of C programmers  C++ Pool of C programmers  C++ n Everybody now learns Java Object-Oriented Analysis and Design (OOA&D) are still very much the leading edge. Object-Oriented Analysis and Design (OOA&D) are still very much the leading edge. Object-Oriented Databases (OODBMS) are powerful and rapidly catching up. Object-Oriented Databases (OODBMS) are powerful and rapidly catching up. l RDBMSs are going O-O.

78 Copyright Flying Kiwi Productions Inc. Object-Oriented Development Environments so far are mostly Object-Oriented Front Ends that link to a relational database. Object-Oriented Development Environments so far are mostly Object-Oriented Front Ends that link to a relational database. l They are truly O-O only in the GUI. l They are evolving toward true O-O, l And so are the relational databases! n ORACLE 9i permits O-O Object-Oriented Models

79 Copyright Flying Kiwi Productions Inc An Introduction to Objects l Like an entity, an object is described by a noun, And it is “ Some thing in the user’s world that has a separate and distinct existence, and is of interest in that they need to keep data about it. ” And it is “ Some thing in the user’s world that has a separate and distinct existence, and is of interest in that they need to keep data about it. ”

80 Copyright Flying Kiwi Productions Inc. l But an object is more than an entity. In addition to the data, the object carries program code, In addition to the data, the object carries program code, That uses or changes that data. That uses or changes that data An Introduction to Objects

81 Copyright Flying Kiwi Productions Inc. Now here is the fundamental principle of Objects:

82 Copyright Flying Kiwi Productions Inc. The only way that a program can read or change can read or change the data carried by an object, or access the data in any way at all is by invoking one of the defined pieces of program code that the object carries within itself An Introduction to Objects

83 Copyright Flying Kiwi Productions Inc. I’ll say that again An Introduction to Objects

84 Copyright Flying Kiwi Productions Inc. The only way that a program can read or change can read or change the data carried by an object, or access the data in any way at all is by invoking one of the defined pieces of program code that the object carries within itself An Introduction to Objects

85 Copyright Flying Kiwi Productions Inc. This can be illustrated with a Taylor Donut Diagram: 4.5. An Introduction to Objects Change Address Print Balance List all Update Balance Change Phone No Change Name Create Customer Delete Customer Name Jo Address Here Phone No 555 Balance $1.49 Customer

86 Copyright Flying Kiwi Productions Inc An Introduction to Objects The “behaviors” around the outside are subroutines or functions. The “behaviors” around the outside are subroutines or functions. They physically are pieces of compiled program code. They physically are pieces of compiled program code. In the real world they correspond to things this object can do or have done to it. In the real world they correspond to things this object can do or have done to it.

87 Copyright Flying Kiwi Productions Inc An Introduction to Objects l These are called variously: s Functions s Behaviors s Operations s Services s Responsibilities s Methods (esp. at the OOP level) l The data in the center is surrounded and protected by them.

88 Copyright Flying Kiwi Productions Inc An Introduction to Objects l Thus, as Coad and Yourdon put it, l An object encapsulates both “the data, and the exclusive functions on that data.” l By “exclusive” we mean that no other code can access or manipulate this data.

89 Copyright Flying Kiwi Productions Inc. l So our task as Analysts is to investigate the users’ business to find: s The objects and their classes s Their attributes and associations s The operations that can be performed on, to, with or by these objects. l Then we check how each operation will use or affect the data attributes. l In the Design phase we produce specs for each operation. l In Coding we use these specs to write them as methods in whatever OOPL we chose An Introduction to Objects

90 Copyright Flying Kiwi Productions Inc. OOPLs and OODBMSs actually store the program code for the methods in the database along with the data. OOPLs and OODBMSs actually store the program code for the methods in the database along with the data. We write small pieces of code, each to do a single operation. We write small pieces of code, each to do a single operation. l A Customer object will need:  An operation called UpdateAddress  A piece of code to carry it out This code is then attached to the object in the database An Introduction to Objects

91 Copyright Flying Kiwi Productions Inc. When an object is first created, it appears as a collection of fields (attributes) in RAM. When an object is first created, it appears as a collection of fields (attributes) in RAM. Some are deleted after a short lifetime. Some are deleted after a short lifetime. Some disappear when the machine is turned off. Some disappear when the machine is turned off. These are all Transient Objects, which DO NOT survive beyond the current session. These are all Transient Objects, which DO NOT survive beyond the current session An Introduction to Objects

92 Copyright Flying Kiwi Productions Inc. l Some objects we need to keep around longer s Customers s Employees s Products, etc. l i.e., all the things we normally would expect to put in a database. l These we create as Persistent Objects, that DO survive beyond the current session An Introduction to Objects

93 Copyright Flying Kiwi Productions Inc. Objects are entities ( things that carry data) with behavior (operations) added. Objects are entities ( things that carry data) with behavior (operations) added. l These operations exclusively access the data it carries - no other code can touch it. Operations are coded in an OOPL or OODBMS as methods (functions, subroutines). Operations are coded in an OOPL or OODBMS as methods (functions, subroutines). Code for the methods is stored in the database along with the data for the object. Code for the methods is stored in the database along with the data for the object. Any program that wants data from this object can get it only by calling one of the methods defined on this object. Any program that wants data from this object can get it only by calling one of the methods defined on this object An Introduction to Objects Summary

94 Copyright Flying Kiwi Productions Inc. Transient Objects are created by OOPLs in the RAM of the computer and Transient Objects are created by OOPLs in the RAM of the computer and DO NOT Survive DO NOT Survive the current session. Persistent Objects are stored by a database (OODBMS) and Persistent Objects are stored by a database (OODBMS) and DO Survive beyond the current session An Introduction to Objects Summary

95 Copyright Flying Kiwi Productions Inc Object-Oriented vs Object-Based l Some programming languages have objects but do not qualify as Object-Oriented. n e.g. ADA 85, Clipper l To be truly O-O, they must have two important features: Inheritance, and Inheritance, and Polymorphism Polymorphism (These are defined and fully explained in Chapter 8) l These two features account for a great deal of the power and benefits of O-O methods.

96 Copyright Flying Kiwi Productions Inc Conceptual, Logical & Physical Models l There are a variety of modeling paradigms available: DFDs, ERDs, Objects, etc. l Each can be done at three levels. These are three different levels of abstraction: These are three different levels of abstraction:ConceptualLogicalPhysical

97 Copyright Flying Kiwi Productions Inc. l A physical model is one that shows in full detail: n Who will do each process n Physically where the data will be stored n What communications medium data will be transferred on 4.7. Conceptual, Logical & Physical Models

98 Copyright Flying Kiwi Productions Inc. A physical model is the final design document showing how things will be written, done or built, and depicting all hardware and software platform details, including data storage and data transmission media Conceptual, Logical & Physical Models

99 Copyright Flying Kiwi Productions Inc. At the logical level, we build a model that shows everything that must be included, and everything that the system must do, without specifying how. It makes no reference to choices of hardware, software or media Conceptual, Logical & Physical Models

100 Copyright Flying Kiwi Productions Inc. A logical model shows what a system must do or have, without regard for how it is to be done, built or represented Conceptual, Logical & Physical Models

101 Copyright Flying Kiwi Productions Inc. A conceptual model is like a logical one, except that it shows the users’ concept of their operation. A conceptual model is like a logical one, except that it shows the users’ concept of their operation. l It will miss out a lot of behind-the-scenes activity and structure Things that must be there, i.e., must exist or must happen, even though the users are mostly unaware of them. Things that must be there, i.e., must exist or must happen, even though the users are mostly unaware of them. l These things are added when we later make a logical model. It includes many-to-many associations. It includes many-to-many associations Conceptual, Logical & Physical Models

102 Copyright Flying Kiwi Productions Inc. A Conceptual Model is a representation of the users’ business in terms of their conception of how it operates. For ERDs and Object models, this means it includes M:M associations Conceptual, Logical & Physical Models

103 Copyright Flying Kiwi Productions Inc. We begin by working with the users to produce a conceptual model. We begin by working with the users to produce a conceptual model. Then we expand that into a logical model by adding all the features that were not apparent to the users. Then we expand that into a logical model by adding all the features that were not apparent to the users. Finally we make all our design decisions and document them on the physical model. Finally we make all our design decisions and document them on the physical model Conceptual, Logical & Physical Models

104 Copyright Flying Kiwi Productions Inc Models as Communication Tools l Users always accuse us “technoids” of speaking in a foreign tongue. l They complain that: l “Those computer people never listen to us,” l or “They never do what we were asking for” l or “They gave us way more than we needed” l or “They can never explain in English how to make it work.”

105 Copyright Flying Kiwi Productions Inc. The secret to solving all of these is Communication, but “The biggest problem with communication is the illusion that it has taken place!” the illusion that it has taken place!” 4.8. Models as Communication Tools

106 Copyright Flying Kiwi Productions Inc. To build an accurate model, it is essential that you are user-driven in your modeling. To build an accurate model, it is essential that you are user-driven in your modeling. The difference between a good systems analyst and a great one is in people skills, especially listening skills. The difference between a good systems analyst and a great one is in people skills, especially listening skills. l “God gave us two ears and one mouth!” Remember, we are using our object-oriented techniques to understand their business. Remember, we are using our object-oriented techniques to understand their business Models as Communication Tools

107 Copyright Flying Kiwi Productions Inc. l Once the users learn the notation, they quickly take to using the model to discuss and solve problems with the analysts. l All players on the team and sometimes outside it can make use of these models Models as Communication Tools

108 Copyright Flying Kiwi Productions Inc. End of Chapter Four.