DOC PREVIEW
SJSU CMPE 226 - CmpE226-DB-L04an

This preview shows page 1-2-3-20-21-22-41-42-43 out of 43 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Database DesignSlide 2Slide 3RelationshipsDependencies (1)Dependencies (2)Associations (1)Types of AssociationAssociations (2)Associations (3)Associations (4)More on AssociationsSlide 13Slide 14Slide 15Slide 16More MultiplicitiesSlide 18N-ary AssociationMore on n-ary AssociationSlide 21Slide 22Slide 24Association ClassAggregation & CompositeSlide 27Slide 28AggregationSlide 30Aggregation ProblemSlide 32AttributesMore on AttributesSlide 35Generalization (1)Generalization (2)InheritanceBase and Leaf ClassesMore on InheritanceSingle and Multiple InheritanceAggregation vs. InheritanceDiscussion Questions© 2003-2006 Dr. M.E. FayadSJSU -- CmpEDatabase DesignDr. M.E. Fayad, ProfessorComputer Engineering Department, Room #283I College of EngineeringSan José State UniversityOne Washington SquareSan José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S2 Relationships2Lesson 04A:Relationships© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S3 Relationships Lesson ObjectivesObjectives3Discuss UML AssociationsDiscuss UML – aggregationUnderstand UML- inheritanceUnderstand How to identify UML Artifacts© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S4 RelationshipsA relationship is a connection among thingsThree most important relationships in OO–dependencies–generalizations–associationsDifferent kind of lines are used to distinguish various kinds of relationships4Relationships© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S5 RelationshipsDependencies are using relationshipsState that a change in specification of one thing (the supplier) may affect another thing that uses it (the client), but not necessary the reverseGraphically, it is rendered as a dashed directed line5Dependencies (1)© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S6 Relationships6Dependencies (2)Dependent ClassIndependent ClassOrderBookClientSupplier© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S7 RelationshipsAn association shows a two-way relationship between objects (instances) of two or more classes and requiring special implementation to ensure integrity.A particular instance of an association is often called a link.Associations between classes are required if the objects need to communicate.Associations are often named, and have role-names for each side of the link.7Associations (1)© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S8 RelationshipsUnary association–both ends of an association circle back to the same classBinary association–an association that connects exactly two classesN-ary association–an association that connects more than two classes8Types of Association© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S9 RelationshipsName–an association can have a name, and the name is used to describe the nature of the relationshipRole–when a class participates in an association, it has a specific role that it plays in that relationship–a role is just the face the class at the near end of the association presents to the class at the other end of the association9Associations (2)© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S10 Relationships10Associations (3)Association NamePersonnameageaddressCarmodelyear# of doorsregisteredCar ownerVehicle RegistrationRoles Names© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S11 Relationships11Associations (4)Person Company1..**Owns byNameemployeeemployerRole NameMultiplicity© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S12 RelationshipsSimple example:An association has a name and a numerical specification (multiplicity indication) of how many objects on one side of the association are connected with how many objects on the other side.Associations are called use relationships – even if this may seem somewhat cheeky in the example below12More on AssociationsWindow GeomFiguredisplays 0..*Company Personemploys 0..*Employer Employee© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S13 RelationshipsAssociations are directed (one way), bidirectional, and undirected.UML makes no distinction between bidirectional and undirected associations.13More on AssociationsClass1 Class2StereotypeRelationName{Constraints}*role1 Role2: interfaceMultiplicity© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S14 RelationshipsRecursive association: A class has a relation with itself.It is also possible to model associations that are valid only temporarily “stereotype or temporary”Constraints may be used to restrict the relation under specific aspects.A role name describes how the object is seen by the opposite object in the association.An association can be described in more detail by means of constraints, tagged values, and stereotypes.Stereotypes are noted before or above the relation name, constraints, and tagged values after or below the name.14More on Associations© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S15 RelationshipsDirected association is a one-way association, in which one side knows the other, but not vice versa.Multiplicity Specification:–1 exactly one–0, 1 zero or one–0..4 between zero and four–3, 7 either three or seven15More on Associations© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S16 RelationshipsMore multiplicity specifications:–0..* greater than or equal to zero (default)–* ditto–1..* greater than or equal to one–0..3, 7, 9..* between zero and three, or exactly seven, or greater than or equal to nine.16More on Associations© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S17 RelationshipsMultiplicity–how many objects may be connected across an instance of an association–can be a range of values or an explicit value•exactly one 1•zero or one (optional) 0..1•zero or more (many) 0..*•one or more (mandatory) 1..*•numerically specified m..n17More Multiplicities© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S18 RelationshipsRecursive associations are associations in which one class is involved.18More on AssociationsEmployeenamestaffNoroomNoPersonPatient1managerreports toleadsoffice clerkhas**relative© 2003-2006 Dr. M.E. FayadSJSU -- CmpE M.E. Fayad L4-S19 RelationshipsAn n-ary association is like a common (binary) association, except that more than two association roles involved in it. 19N-ary AssociationClass1


View Full Document

SJSU CMPE 226 - CmpE226-DB-L04an

Documents in this Course
SQL-99

SQL-99

71 pages

XML

XML

52 pages

XML

XML

14 pages

Chapter 9

Chapter 9

45 pages

Load more
Download CmpE226-DB-L04an
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CmpE226-DB-L04an and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CmpE226-DB-L04an 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?