Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
2009/09/291/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Systems Modeling
Lecture2009/29/09
2009/09/292/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Outline
● Development methods and modeling● Concrete, abstract, example● Objects first development method● Story driven modeling● Final exercise
2009/09/293/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Discussion about Programming Experience and Modeling
● Who likes to program?● Who likes to program in “real” projects (who
prefers just for fun)?● Who uses modeling in their development
environment (in “real” projects in fun projects)?
● Who likes to use modeling (private, work)?● What is wrong? / Is anything wrong?
2009/09/294/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Models in the Development Process
● Team up with 3-4● Write down how you depict an ideal
development process and write down the use and importance of models and design documents in it (15 minutes)
● Report
2009/09/295/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Concrete vs. Abstract
● Form teams of 3-4● Discuss and write down examples for
concrete and abstract things (10 examples).
● Create definitions of concrete, abstract, and example
● Write down two ideas, what this could have to do with modeling.
● Work on this for 15 minutes.● Report
2009/09/296/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
What is an example?● Concrete!● Wictionary (example):
– Something that is representative of all such things in a group.
– Something that serves to illustrate or explain a rule.– Something that serves as a pattern of behavior to be
imitated (a good example) or not to be imitated (a bad example).
– A parallel or closely similar case, especially when serving as a precedent or model.
– An instance (as a problem to be solved) serving to illustrate the rule or precept or to act as an exercise in the application of the rule.
2009/09/297/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
What role can examples play in software development?
● Documentation● Design documents● Models● Test cases● Mean to communicate with a customer● Analysis documents
2009/09/298/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Example for an Example
Ralph Smith, 33 years old, investment banker for Goldman Sachs, wants relocate within London. He is currently in his private office at his apartment in London/Maidavale. He opens his Webbrowser and selects from his bookmarks inferato.com.
The initial webpage shows in the header: “You are currently located in London/Maidavale”. The left sidebar shows the categories “Housing, Events, Jobs, Other classifieds”. As Ralf has recently looked for buying a special electric guitar in the neighbourhood, the button “other classifieds” is pressed. He selects the Housing button, Other classifieds is automatically deselected and the first 10 search results show up. The first hit shows a description […]The second hit shows as description: “Nice quiet 3 bedroom apartment in Notting Hill with a perfect view and short ways to groceries and medical facilities.”He clicks on details, a window pops up showing the id 9928299, that this apartment is for sale, has 3 bedrooms [...]
This is sometimes calleduser story, scenario (a scenariois usually longer than auser story), business case, orseldom textual use case.
This is sometimes calleduser story, scenario (a scenariois usually longer than auser story), business case, orseldom textual use case.
2009/09/299/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Scenario (our definition)● Very concrete story (assume the
development project already exists)● Long (half a page up to several pages)● Describing the system to develop● A case for things happening in and in
interaction with the system
2009/09/2910/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
User Story (our definition)
● Very concrete example of the problem to solve (assume the development project already exists)
● Very short (less than half a page) – fits on a flash card
● Write down as:– Title– Pre condition– Action (<3 sentences)– Post condition
2009/09/2911/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Example, User Story
● Taken from user-story Wikipedia:Starting Application
The application begins by bringing up the last document the user was working with.
● Why does this not fit our definition?– Structure (no, pre- and post-condition)– Not concrete– => This is more a use-case
2009/09/2912/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Better Example for User Story
Title: Starting SuperTextEdit the second time
Precondition: SuperTextEdit has just been closed. The document mytext.txt had been edited by the user ulno and “Hello world!” had been written in it. Then SuperTextEdit had been closed and mytext.txt saved. SuperTextEdit is not running.
Action: SuperTextEdit is started again (approx. two minutes later) by user ulno on the same pc. mytext.txt is loaded and the main text-window of SuperTextEdit is displayed with mytext.txt as content.
Postcondition: SuperTextEdit is running and waits now for input and shows a blinking cursor at the end of the text.
2009/09/2913/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Towers of Hanoi
http://en.wikipedia.org/wiki/Towers_of_hanoi
Discs should be moved interactively.
2009/09/2914/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Create User Story“Move red disk to second place”
● Title: Move red disk to second place
● Teams● Write down User Story (10min)● Report
2009/09/2915/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
User Story
● Title: Move red disk to second place● Precondition: red d. (size 1), yellow d. (size
2), blue d. (size 3), and orange disc (size 4) sorted on initial towerplace (of 3)
● Action: The player moves the red disc onto the second towerplace
● Postcondition: yellow, blue, and orange disc sorted on initial towerplace (of 3), red on second towerplace
2009/09/2916/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Use Cases and Use Case Diagrams
● Compile down with your neighbor a one page document, what the key elements of use cases, use case summary, and Use Case Diagrams are (10 minutes)
● Team up to teams with four and compile a one page document how you could relate user stories and use cases, create a use case summary for the Towers-of-Hanoi user story (10 minutes)
● Report
2009/09/2917/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Object
● A thing, being or concept ● A language mechanism for binding data
with methods that operate on that data● A representation of a physical object● Instance of a class● Objects represent “things” from the real
world, or from some problem domain
● How do objects and examples relate?
2009/09/2918/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Distinguishing Objects
● How can these be distinguished?– all persons in the world for the purpose of
sending mail– all persons in the world for the purpose of
criminal investigations– all customers with safe deposit boxes in a
given bank– all customers of a telephone company for
billing purposes– all employees of a company to restrict access
for security reasons
2009/09/2919/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Objects First Method
● Scenarios● User stories
– Tests– base for measurement
● Use cases● Object diagrams Class diagrams→● Story diagrams
● What is different to your dev. process?
2009/09/2920/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Modeling Objects
Red-Disc
size: 1
http://en.wikipedia.org/wiki/Towers_of_hanoi
Yellow-Disc
size: 2
2009/09/2921/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Modeling Objects Relations/Interaction
Red-Disc
size: 1
Yellow-Disc
size: 2lies on
2009/09/2922/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
User Story (revisited),how to identify objects?
● Title: Move red disk to second place● Precondition: red d. (size 1), yellow d. (size
2), blue d. (size 3), and orange disc (size 4) sorted on initial towerplace (of 3)
● Action: The player moves the red disc onto the second towerplace
● Postcondition: yellow, blue, and orange disc sorted on initial towerplace (of 3), red on second towerplace
2009/09/2923/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
User Story,identify objects
● Title: Move red disk to second place● Precondition: red d. (size 1), yellow d. (size
2), blue d. (size 3), and orange disc (size 4) sorted on initial towerplace (of 3)
● Action: The player moves the red disc onto the second towerplace
● Postcondition: yellow, blue, and orange disc sorted on initial towerplace (of 3), red on second towerplace
2009/09/2924/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Model an Object Diagram
● Team● Object diagram for Move red disk, pre
condition (15min)– show change to post condition– what is special about this, what did you do for
this change?– how can we go from here to class diagrams?
● Report
2009/09/2925/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Object DiagramRed Disc
size: 1
Yellow Disc
size: 2
Blue Disc
size: 3
Orange Disc
size: 4
1st Towerplace 2nd Towerplace 3rd Towerplace
lies on top of
lies on top of
lies on top of
lies on top of
is next to is next to
Precondition for move red disc
Player
2009/09/2926/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Object DiagramRed Disc
size: 1
Yellow Disc
size: 2
Blue Disc
size: 3
Orange Disc
size: 4
1st Towerplace 2nd Towerplace 3rd Towerplace
lies on top of
lies on top of
lies on top of
lies on top of
is next to is next to
Postconditionfor move reddisc
Player
2009/09/2927/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Object Diagram (revisited)Red Disc
size: 1
Yellow Disc
size: 2
Blue Disc
size: 3
Orange Disc
size: 4
1st Towerplace 2nd Towerplace 3rd Towerplace
lies on top of
lies on top of
lies on top of
lies on top of
is next to is next to
Postconditionfor move reddisc
Player
2009/09/2928/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Class diagram
Playeromitted
upperlower
2009/09/2929/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Dynamic Object Browsing in Eclipse (eDobs) + Demo
2009/09/2930/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Story Diagrams
● Fujaba● Merge of State Diagrams, Activity Diagrams,
and Sequence Diagrams● Allow to visually model code via Graph
transformation of Object space
2009/09/2931/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Some Elements of Story Diagrams
2009/09/2932/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Some Elements of Story Diagrams
2009/09/2933/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Story Diagram in Code + Demo
2009/09/2934/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
ExerciseConsider a computer email system● List three actors. Explain the relevance of
each actor.● Prepare a scenario● Break the scenario into small user stories● Draw the object diagrams for pre and post-
conditions● Derive use cases and sort user stories● Derive the class diagram● … SDM
2009/09/2935/35
Ulrich Norbisrath (http://ulno.net)University of Tartu
Systems Modeling, Fall 2009http://teaching.ulno.net
Summary
● Be able to decide when to be concrete or abstract
● Objects first● Story driven modeling