Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

UML Class Modeling

No description
by

ashwin ittoo

on 22 October 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of UML Class Modeling

How to represent the domain? Modeling/formalizing a given domain
Model is realized in computer software, e.g. Enterprise Resource Planning (ERP) Domain Modeling When is Domain Modeling needed? Implementing software ("Information System") to
Manage inventory of Albert Heijn stores
Support operations of DHL
Handle orders and delivery of your local pizza shop in Bafflo According to the Unified Modeling Language (UML) standards
MS-Visio commonly used for Domain Modeling in UML UML Basics 3 fundamental notions:
Classes (Object types)
Attributes (Object properties)
Methods (Actions) Classes/Object Types General descriptions of objects (templates) Example: Class for students Attributes:
Id
Name
Age
Gender
Year
... Class name: Student
(Class name is usually a singular noun) Methods:
Calculate GPA
Check course eligibility
... Object Type Student in UML Using MS-Visio You will get a blank sheet
Make sure that you are currently in UML Static Structure (Metric) under Shapes Select the UML Model Diagram template Press Ok to when you are done Specify the methods in Operation:
Only the Operations column in needed
Pay attention to the method name in the figure
We will not focus on methods in this course Define the attributes
Only the column Attribute is needed for our case Change the class name Click and drag Class into your sheet

Resize the class as needed




Double click on the class Press Ok to when you are done...et voila! Specify the methods in Operation:
Only the Operation column in needed
Pay attention to the method name in the figure
We will not focus on methods in this course Define the attributes
Only the column Attribute is needed for our case Change the class name Click and drag a Class item into your sheet

Resize the class as needed




Double click on the class Instantiating Objects Creating objects (instances) from the classes
Achieved by assigning values to attributes

E.g. 2 student objects Id: 456
Name: Marlou
Address: Stedum
…. Id: 123
Name: Pierre
Address: Anjum
…. Relationships between Object Types Objects (object types) are related via various relationships

Example:
Students can register for 1 or more courses
Courses may be registered by 1or more students Common Relationships "is-a" Between types and subtypes
Denotes class specialization
E.g. different types of students (part-time, full-time) Common Relationships (cont) part-whole Between parts and their wholes
2 flavors:
Composition, when the existence of the "part" depends on the existence of the "whole"
Aggregation, when the "part" and "whole" are independent




The UML notation for aggregation is an “un-shaded” diamond

To draw it in Visio,
Draw a composition relation, right-click it, and select Properties under Association Ends, select Shared in the Aggregation column

A navy consists of 1 or more warships
The existence of warships is independent of the navy
(If the navy is dismantled, the warships will still exists) The UML notation for composition is a shaded diamond, which is also available in Visio

“A building consists of 1 or more rooms; a room is part
of 1 building”
The existence of the rooms depends on the existence of the building
(Destroying the building causes the rooms to be destroyed) In Visio, under Association Ends, select 1..* for End1 to indicate that a course can be taken by 1 or more (“*”) students






Similarly, select 1..* for End2 to indicate that a student can take 1 or more courses Next, we enforce the cardinality requirements
Req1: A course can be taken by 1 or more students (End1 in the Visio UML)
Req2: Each student can register for 1 or more course (End2 in the Visio UML) This only indicates about the existence of relationship between the classes

Right-click on the relation (the straight line) and select Properties to
Specify a meaningful name, e.g. Register Create a Class Course in Visio (methods are not required)

Insert a Binary Association between the classes Student and Course
Note: binary association means a relationship between 2 classes Use the Generalization relationship in Visio to indicate class hierarchy

In this example, Full-time and Part-Time students are “specialized” types of students

The specialized classes inherit all the attributes of the generalized class (Student)
There is no need to repeat them in the classes’ definition

Only the specific attributes need to be mentioned per subtype
E.g. : mentor’s name (mentorName) for full-time students and number of days per week (numDays) for part time students In Visio, under Association Ends, select 1..* for End1 to indicate that a course can be taken by 1 or more (“*”) students






Similarly, select 1..* for End2 to indicate that a student can take 1 or more courses Next, we enforce the cardinality requirements
Req1: A course can be taken by 1 or more students (End1 in the Visio UML)
Req2: Each student can register for 1 or more course (End2 in the Visio UML) This only indicates about the existence of relationship between the classes

Right-click on the relation (the straight line) and select Properties to
Specify a meaningful name, e.g. Register Create a Class Course in Visio (methods are not required)

Insert a Binary Association between the classes Student and Course
Note: binary association means a relationship between 2 classes Dr. Ashwin Ittoo
r.a.ittoo@rug.nl
DUI 651
Full transcript