15
CIT731: Database Development Multiplicity DeSiaMore Powered by DeSiaMore 1

CIT731: Database Development

  • Upload
    midori

  • View
    40

  • Download
    3

Embed Size (px)

DESCRIPTION

CIT731: Database Development. Multiplicity. Multiplicity. Multiplicity is a special type of association which shows the number of objects from one class that relate with a number of objects in an associated class. One class can relate to each in:- One-to-one One-to-many One-to-one or more - PowerPoint PPT Presentation

Citation preview

Page 1: CIT731: Database Development

CIT731: Database Development

Multiplicity

DeSiaMore Powered by DeSiaMore 1

Page 2: CIT731: Database Development

Multiplicity

Multiplicity is a special type of association which shows the number of objects from one class that relate with a number of objects in an associated class.

One class can relate to each in:-One-to-oneOne-to-manyOne-to-one or moreOne-to-zero or one

DeSiaMore Powered by DeSiaMore 2

Page 3: CIT731: Database Development

Multiplicity and Association

The UML uses an asteristick (*) to represent more and to represent many.

Reflexive association is one in which it involves the association of the class with itself

DeSiaMore Powered by DeSiaMore 3

Page 4: CIT731: Database Development

Multiplicity and Association

Example of reflexive association

DeSiaMore Powered by DeSiaMore 4

Page 5: CIT731: Database Development

Association

Without relationships,a class model would be a list of rectangles that represent a vocabulary of system.

Relationships show how the terms in the vocabulary connect with one another to provide a picture of the slice of the world you’re modeling.

DeSiaMore Powered by DeSiaMore 5

Page 6: CIT731: Database Development

Object ModelingObject Diagrams Object Diagram

A graph of instances that are compatible with a given class diagram; also called an instance diagram

Object is represented as a rectangle with two compartments

Operation A function or service that is provided by all the

instances of a class Encapsulation

The technique of hiding the internal implementation details of an object from its external view

DeSiaMore Powered by DeSiaMore 6

Page 7: CIT731: Database Development

Object ModelingObject Diagrams Types of Operations

Query An operation that accesses the state of an object but

does not alter the state Update

An operation that alters the state of an object Scope

An operation that applies to a class rather than an object instance

Constructor An operation that creates a new instance of a class

DeSiaMore Powered by DeSiaMore 7

Page 8: CIT731: Database Development

FigureUML class and object diagrams(a) Class diagram showing two classes(b) Object diagram with two instances

DeSiaMore Powered by DeSiaMore 8

Page 9: CIT731: Database Development

Representing Associations

Association A relationship between object classes Degree may be unary, binary, ternary or higher Depicted as a solid line between participating

classes Association Role

The end of an association where it connects to a class

Each role has multiplicity, which indicates how many objects participate in a given association relationship

DeSiaMore Powered by DeSiaMore 9

Page 10: CIT731: Database Development

Representing Association Classes Association Class

An association that has attributes or operations of its own, or that participates in relationships with other classes

Similar to an associative entity in ER modeling

Figure 20-9 shows one example

DeSiaMore Powered by DeSiaMore 10

Page 11: CIT731: Database Development

Representing Derived Attributes, Derived Associations and Derived Roles

Derived attributes, associations and roles can be computed from other attributes, associations or roles

Shown by placing a slash (/) before the name of the element

DeSiaMore Powered by DeSiaMore 11

Page 12: CIT731: Database Development

Representing Generalization

Generalization Abstraction of common features among multiple

classes, as well as their relationships, into a more general class

Subclass A class that has been generalized

Superclass A class that is composed of several generalized

subclasses

DeSiaMore Powered by DeSiaMore 12

Page 13: CIT731: Database Development

Representing Generalization Discriminator

Shows which property of an object class is being abstracted by a generalization relationship

Inheritance A property that a subclass inherits the features

from its superclass Abstract Class

A class that has no direct instances, but whose descendents may have direct instances

Concrete Class A class that can have direct instances

DeSiaMore Powered by DeSiaMore 13

Page 14: CIT731: Database Development

Representing Generalization Semantic Constraints among Subclasses

Overlapping A descendant may be descended from more than one

of the subclassesDisjoint

A descendant may not be descended from more than one of the subclasses

Complete All subclasses have been specified. No additional

subclasses are expected Incomplete

Some subclasses have been specified, but the list is known to be incomplete

DeSiaMore Powered by DeSiaMore 14

Page 15: CIT731: Database Development

Representing Generalization Class-scope Attribute

An attribute of a class which specifies a value common to an entire class, rather than a specific value for an instance.

Abstract Operation Defines the form or protocol of an operation but not its

implementation Method

The implementation of an operation Polymorphism

The same operation may apply to two or more classes in different ways

DeSiaMore Powered by DeSiaMore 15