A Bit Of History - University of Huddersfield

Download Report

Transcript A Bit Of History - University of Huddersfield

Methods and Modelling
Dr Steve Wade
The Vision
Business
Computing
A Dog Kennel
Can be built by one
person
Requires
 Minimal modeling
 Simple process
 Simple tools
A House
Built most efficiently by
a team
Requires
 Modeling
 Well-defined process
 Power tools
But what about a
skyscraper?
Or a magnificent structure
like this...
What about the contents?
Stock control
Loans
Reservations
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?
Modelling Information
Systems
What kind of
blueprints are
required?
We will produce blueprints of information
systems using the Unified Modelling
Language
It consists of dozens of types of drawing
It can be used by everyone on a
development project
Different drawings are for different people
e.g. managers, programmers, analysts, users etc.
An Object Oriented Fairy Story
A gentle introduction to the Unified Modelling
Language
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
Little Red Riding Hood
A story told in rhyme involving
four characters and a basket
of groceries
Acknowledgements
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
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."
A Class Diagram
lives in
Red Riding
Hood
takes
grocery
butter
House
near
Wood
cake
The Notation
Red Riding
Hood
An object
lives in
A one-way relationship
near
A two-way relationship
A “kind of” relationship
A Class Diagram for Ordering
Customer
Order
Product
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
Databases
Programs
Use Cases
Interaction Models
Business
Class
Diagrams
Computing
The story continues ...
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."
A Class Diagram
Red Riding Hood has some
“attributes”, she is obliging and
sweet
Red Riding Hood
Obligingness
Sweetness
meet
Wolf
Talk()
And the wolf has some “operations”
- he can talk
And they meet in the wood, so they
have a “relationship”
A Class Diagram in a Business System
Customer
Name
Address
Telephone Number
Order()
Pay()
Order
Date
1..n Total Price
Dispatch()
Deliver()
PayFor()
1..n
How could this be
implemented in
software?
Product
Name
Item Price
AddToStock()
TakeFromStock()
The story continues ...
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
nosegay
With the wild flowers that grew in the
glade.
So RRH has
operations linger and
play
And she makes a nosegay
Nosegay
makes
Red Riding Hood
Obligingness
Sweetness
picks
flowers
Linger()
Play()
That is made of
flowers that she
picks
A “made of” relationship
The story continues ...
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:
A Sequence Diagram
: Wolf
: Cottage
: Grandma
knock
rouse
enter
eat
get in
: Bed
A Sequence Diagram to Print an Invoice
: Print Invoice
: Customer
Record
: Sales Items
GetName( )
PrintCustName( )
GetAddress( )
PrintCustAddress( )
GetUnbilledItems( )
PrintLines( )
PrintTotal( )
PrintTermsConditions( )
: Invoice
The Vision
“Soft” Systems Models
Databases
Programs
Use Cases
Object
Interaction Models Models
Business
Computing
The story continues ...
"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 himself
Very carefully (such was his plan):
"Put your basket and things, little
dear, on the shelf,
"And come into bed to your Gran."
Inheritance
We have three
types of
character in the
story
Wolf
Talk()
Eat()
Character
So we can have a
“Character” object
Red Riding Hood
Obligingness
Sweetness
Grandma
Linger()
Play()
And all the other characters are “types” of Character
Inheritance
Character
Talk()
Eat()
Now we can group
common properties in
Character
All characters “inherit”
the properties of
Character
Wolf
Red Riding Hood
Obligingness
Sweetness
Linger()
Play()
Grandma
So both Grandma and
Red Riding Hood can
Talk and Eat
The story continues ...
The obedient child laid her down by
the side
Of 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.
A Statechart Diagram
At home
RRH starts life at home
At
Grandma's
Then goes back and forth
to Grandma’s
In bed with
Wolf
Until she climbs in bed
with the Wolf
At home
Then she goes home
traumatised where she
stays until she dies
[ goods not in stock ]
[ goods in stock ]
waiting
dispatch
on route to
customer
delivered
billed
order payed for
waiting
delivery
Statechart
diagram for an
order
order cancelled
The End
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
Databases
Programs
Use Cases
Object
Models
Interaction Models
Business
Computing
Let’s get started