An information system for the library
..is no more easy to design than the library itself
How do we model an information system before constructing it?
We will produce blueprints of information systems using the Unified Modelling Language
It can be used by everyone on a development project
It consists of dozens of types of drawing
Different drawings are for different peoplee.g. managers, programmers, analysts, users etc.
An Object Oriented Fairy StoryAn Object Oriented Fairy Story
A gentle introduction to the Unified Modelling A gentle introduction to the Unified Modelling LanguageLanguage
Learning the basics of UML takes many weeks (longer than courting a princess)
Most IT degrees teach UML
We shall give a flavour of the language by using a Fairy Story as an illustration
The Little Red Riding Hood Project, editor, "Michael N. Salda,"
in
"The de Grummond Children's Literature Research Collection, University of Southern Mississippi,"
http://www-dept.usm.edu/~engdept/lrrh/lrrhhome.htm“
And Ken Lunn School of Computing and Engineering University of Huddersfield
Acknowledgements
A long time ago, in a house near a wood,As most pretty histories go,A nice little girl lived, called Red Riding Hood,As some of us already know.One day said her mother, "Get ready, my dear,"And take to your Granny some cakes,"And a pot of fresh butter to soothe her and cheer;"Ask after her pains and her aches."
Red Riding Hood An object
lives inA one-way relationship
near A two-way relationship
A “kind of” relationship
The Notation
Customer Order
Product
A Class Diagram for Ordering
In the design of a system, the objects and relationships are drawn as above.Systems usually contain hundreds of objects.
The Vision (with some UML Jargon)
“Soft” Systems Models
Use Cases
Interaction Models
ClassDiagrams
Programs
Databases
BusinessComputing
Out set Riding Hood, so obliging and sweet,And she met a great Wolf in the wood,Who began most politely the maiden to greet,In as tender a voice as he could.He asked to what house she was going, and why;Red Riding Hood answered him all:He said, "Give my love to your Gran; I will try"At my earliest leisure to call."
Red Riding Hood
ObligingnessSweetness
Wolf
Talk()
meet
Red Riding Hood has some “attributes”, she is obliging and sweet
And the wolf has some “operations” - he can talk
And they meet in the wood, so they have a “relationship”
A Class Diagram
Customer
NameAddressTelephone Number
Order()Pay()
Order
DateTotal Price
Dispatch()Deliver()PayFor()
Product
NameItem Price
AddToStock()TakeFromStock()
1..n
1..n1..n
A Class Diagram in a Business System
How could this be implemented in software?
Off he ran, and Red Riding Hood went on her way,But often she lingered and played,And made as she went quite a pretty nosegayWith the wild flowers that grew in the glade.
Red Riding Hood
ObligingnessSweetness
Linger()Play()
flowerspicks
Nosegay
makes
So RRH has operations linger and play
And she makes a nosegay
That is made of flowers that she picks
But in the meanwhile the Wolf went, with a grin,At the Grandmother's cottage to call;He knocked at the door, and was told to come in,Then he eat her up--sad cannibal!Then the Wolf shut the door, and got into bed,And waited for Red Riding Hood;When he heard her soft tap at the front door, he said,Speaking softly as ever he could:
: Print Invoice : Sales Items : Invoice : Customer Record
GetUnbilledItems( )
PrintCustName( )
PrintCustAddress( )
PrintLines( )
PrintTotal( )
PrintTermsConditions( )
GetName( )
GetAddress( )
A Sequence Diagram to Print an Invoice
The Vision
“Soft” Systems Models
Use Cases
Interaction Models
ObjectModels
Programs
Databases
BusinessComputing
"Who is there?" "It is I, your dear grandchild; I've brought"Some butter and nice little cakes.""Pull the bobbin, my child, and come in, as you ought;"I'm in bed very bad with my aches."When she entered the room, the old Wolf hid himselfVery carefully (such was his plan):"Put your basket and things, little dear, on the shelf,"And come into bed to your Gran."
Character
GrandmaWolf
Talk()Eat()
Red Riding Hood
ObligingnessSweetness
Linger()Play()
InheritanceWe have three types of character in the story So we can have a
“Character” object
And all the other characters are “types” of Character
GrandmaWolf Red Riding Hood
ObligingnessSweetness
Linger()Play()
Character
Talk()Eat()
Inheritance
Now we can group common properties in Character
All characters “inherit” the properties of Character
So both Grandma and Red Riding Hood can Talk and Eat
The obedient child laid her down by the sideOf her Grandmother dear (as she thought);But all at once, "Granny!" Red Riding Hood cried,"What very long arms you have got!"He answered, "The better to hug you, my child.""But, Granny, what very large ears!""The better to hear you;" the voice was still mild,But the poor little girl had her fears."Grandmother, you seem to have very large eyes!""The better to see you, I trow.""What great teeth you have got!" and the wicked Wolf cries,"The better to eat you up now!"
Red Riding Hood shrieked, and--bang! off went a gun,And shot the old Wolf through the head;One howl and one moan, one kick and one groan,And the wicked old rascal was dead.Some sportsman (he certainly was a dead shot)Had aimed at the Wolf when she cried;So Red Riding Hood got safe home--did she not?And lived happily there till she died.
At home
At Grandma's
In bed with Wolf
At home
RRH starts life at home
Then goes back and forth to Grandma’s
Until she climbs in bed with the Wolf
Then she goes home traumatised where she stays until she dies
A Statechart Diagram
waiting dispatch
on route to customer
delivered
billed
order payed for
waiting delivery
[ goods not in stock ][ goods in stock ]
order cancelled
Statechart diagram for an order
So, what have we seen?
•We can describe things graphically•We can show how things relate•We can show how things cooperate•We can show what things do
The Vision
“Soft” Systems Models
Use Cases
Interaction Models
ObjectModels
Programs
Databases
BusinessComputing