Discover the world at Leiden University Discover the world at Leiden University
Modeling
Programmeertechnieken, Tim Cocx
Modeling Programmeertechnieken, Tim Cocx Discover the world at - - PowerPoint PPT Presentation
Modeling Programmeertechnieken, Tim Cocx Discover the world at Leiden University Discover the world at Leiden University Software development Lifecycle (Requirements) analysis: - Requirements gathering and description - Construction of
Discover the world at Leiden University Discover the world at Leiden University
Modeling
Programmeertechnieken, Tim Cocx
Discover the world at Leiden University
Software development Lifecycle
Discover the world at Leiden University
Analysis
Discover the world at Leiden University
Design
Discover the world at Leiden University
Modeling steps
Problem domain Solution domain Analysis model Design model
Discover the world at Leiden University
Modeling
What is this?
Discover the world at Leiden University
Modeling
Discover the world at Leiden University
Example model
Discover the world at Leiden University
Example model
Discover the world at Leiden University
Example model
Discover the world at Leiden University
Unified Modeling Language
standard to model software.
diagrams
Discover the world at Leiden University
Class diagram
Class diagram
As systemmodel
interaction between objects
Discover the world at Leiden University
Case 1: Mario Wat are the objects?
Discover the world at Leiden University
Case 1: Mario
Discover the world at Leiden University
Case 1: Mario
– Block1 – Etc.
– Block1 – Etc.
Discover the world at Leiden University
Case 1: Mario
Discover the world at Leiden University
Class
Discover the world at Leiden University
Class UML syntax
Human
Discover the world at Leiden University
Coin
Mysteryblock
Block
Platform
Roof
Floor
Hammer
Mushroom
Case 1: Mario
Hammerman
Yoshi
Toad
Luigi
Mario
Discover the world at Leiden University
Inheritance
Child
Adult
What can be done better?
Discover the world at Leiden University
Inheritance UML syntax
Child
Adult
Human
Human
Human Superclass or parent class Subclass of Child class
Discover the world at Leiden University
Inheritance theory
Discover the world at Leiden University
Case 1: Mario
GameElement Moving SelfMoving Enemy Player Humans Toads Yoshi
Hammer Hammerman
Active Coin Platform Mushroom
This is not finished!
Discover the world at Leiden University
Class Diagram: procedure
Discover the world at Leiden University
Case 2: College
The following data needs to be entered for new students: name, student code, date of birth and study coach (at the time of registration every student gets assigned a teacher as his or her coach). Students have a list of grades, study and do exams. After every period, the grades for the courses and the date of the exam must be
Discover the world at Leiden University
Case 2: College
The following data needs to be entered for new students: name, student code, date of birth and study coach (at the time of registration every student gets assigned a teacher as his or her coach). Students have a list of grades, study and do exams. After every period, the grades for the courses and the date of the exam must be entered. The system calculates the average result of the grades. Teachers have a name, date of birth and building. They grade exams and assess students
Discover the world at Leiden University
Case 2: College
noun:Discover the world at Leiden University
– name – date of birth – code – coach – list of grades – do exam – study
– coach-kids – name – date of birth – building – assess students – grade exam
– grade – Date of exam – course
Case 2: College
Discover the world at Leiden University
Case 2: College
Person
Student
Teacher
Result
Discover the world at Leiden University
Case 1: Mario
Interaction??
Discover the world at Leiden University
Case 1: Mario
Which objects interact?
Discover the world at Leiden University
Case 1: Mario
Discover the world at Leiden University
Two Choices
Dependency
Association
Discover the world at Leiden University
Dependency UML Syntax
<< parameter >>
Discover the world at Leiden University
Dependencies: usage stereotypes
Discover the world at Leiden University
Dependencies: Examples
Hammer Hammerman
<< create >>
Coin Player
<< parameter >>
Discover the world at Leiden University
Association UML syntax
Player Yoshi
Discover the world at Leiden University
Association UML syntax
Mushroom MysteryBlock
contains
Mushroom MysteryBlock
contains
Mushroom MysteryBlock container
contents
Yoshi Player
rides
Discover the world at Leiden University
Case 1: Mario
Can Mario ride multiple Yoshis (at the same time)?
Can a mystery block contain multiple mushrooms?
Can a hammerman throw multiple hammers?
Discover the world at Leiden University
Multiplicity UML syntax
Discover the world at Leiden University
Multiplicity UML syntax
Coin MysteryBlock
contains
Yoshi Player
rides * 0..1
0..1 0..1
Discover the world at Leiden University
Class diagram: procedure
Associatie ! (dependency)
Discover the world at Leiden University
Case 2: College
The following data needs to be entered for new students: name, student code, date of birth and study coach (at the time of registration every student gets assigned a teacher as his or her coach). Students have a list of grades, study and do exams. After every period, the grades for the courses and the date of the exam must be entered. The system calculates the average result of the grades. Teachers have a name, date of birth and building. They grade exams and assess students
Discover the world at Leiden University
– name – date of birth – code – coach – list of grades – do exam – study
– coach-kids – name – date of birth – building – assess students – grade exam
– grade – Date of exam – course
Case 2: College
Discover the world at Leiden University
– naam – Geboortedatum – Studentcode – Slb’er – cijferlijst – Inschrijven – Tentamen maken – studeren
– SLB-studenten – Naam – Geboortedatum – Vestiging – Student beoordelen – Cijfers berekenen
– Cijfer – Toetsdatum – Blok
Case 2: Studeren
Discover the world at Leiden University
Case 2: Studeren
Person
Student
Teacher
Result
determines gets Freshman coach 1 1..* 1 * * 1 << parameter >>
Discover the world at Leiden University
Teacher
Associations: observations and rules
Student
2..* 2..* Is friend of 1 * Is boss of
Teacher
Discover the world at Leiden University
Properties of multiplicity
Discover the world at Leiden University
Case 3: Kebab
DönerKings is a large brand of kebab-bakers. Every branch has at least 2 employees, with a certain salary and a
have more than one boss. Branches sell buns and Turkish pizzas (we know the price of both). Buns have a certain content (chicken or veal) and pizzas are sold with different diameters. Both can be eaten. Sometimes branches expand, which means hiring more employees. Buns and pizzas always contain 3 ingredients,that have a certain expiration date, sometimes they spoil. Oh yes! Branches have an owner. That is one of the employees.
Discover the world at Leiden University
Case 3: Kebab
DönerKings is a large brand of kebab-bakers. Every branch has at least 2 employees, with a certain salary and a name. They are hired to bake, fill and sell buns. Some employees manage 2 other employees. It is possible to have more than one boss. Branches sell buns and Turkish pizzas (we know the price of both). Buns have a certain content (chicken or veal) and pizzas are sold with different diameters. Both can be eaten. Sometimes branches expand, which means hiring more employees. Buns and pizzas always contain 3 ingredients, that have a certain expiration date, sometimes they spoil. Oh yes! Branches have an address and owner. That is one of the employees.
Discover the world at Leiden University
Case 3: Kebab
First get rid of synonyms and superfluous words
Discover the world at Leiden University
Case 3: Kebab
Name of customer Explanation of customer synonym Part of verb synonym Possible value of attribute Possible value of attribute Language construct(hint!)Now: make singular and sort
Discover the world at Leiden University
Case 3: Kebab
– address – owner
– salary – name – subordinates
– price
– content
– diameter
– expirationDate
Super class! References another class (àAssociation)
Discover the world at Leiden University
Case 3: Kebab
Different?
– address – owner
– salary – name – subordinates
– price
– content
– diameter
– expirationDate
Discover the world at Leiden University
Case 3: Kebab
Associations / Dependencies:
– Employeeßà branch
– Employee ßà Employee
– Branch ßà Product
– Product ßà Ingredient
Discover the world at Leiden University
Product
TurkishPizza
Bun
Case 3: Kebab
Employee
Branch
Ingredient
sells
contains hires * 2..* * 1..* 1 * 0..1 3 property 2 1
Doubt… NB! (also *?) NB! This is wrong
Boss of
Discover the world at Leiden University
Next up…