SW Eng in Forestry

Download Report

Transcript SW Eng in Forestry

Introduction to UML
“Revisiting the Big Picture”
Alex Fedorec,
Keith Rennolls, Moh Ibrahim
Introduction
• Briefly introduce the Unified Modeling
Language (UML) for information systems
analysis and design.
• Prepare the ground so that we can stand back
and “revisit the big picture” and document it
with UML.
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.2
Introduction to UML
• What is it
• Why use it
• Quick overview of UML
• Essential elements for NEFIS:
• Use cases
• Conceptual class model
• Basic communication model
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.3
What is UML
• Graphical information system modelling
language
• Extensible language not methodology
• Applicable to all applied computing domains
for problem statement and solution description
• An enabling technology for component-oriented
and agent-oriented software engineering
• Mechanism for uniting wide range of needs and
applications within forestry domain
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.4
The Ontology Spectrum
Strong semantics
Modal Logic
First Order Logic
Daconta, M.C., et.al., 2003
Local Domain Theory
DAML+OIL, OWL
UML – The Unified Modelling Language
Conceptual Model
RDF/S
XTM
Extended ER
Is disjoint subclass of
with transitivity property
Is subclass of
Thesarus
ER
Schema
Taxonomy
Relational
Model
Has narrower meaning than
Is subclassification of
Minimal hierarchic knowledge
to rich consistent and
meaningful knowledge
Weak semantics
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.5
Simple Example
KeithsConcreteGrowthModel
Interface:
KeithCGM component provides a
growthModel interface harvest
plan can use
Species
+authority
+growthRate
+provenance
-name
IGrowthModel
Harvestplan
-slashDisposal
-sustainableYieldCapacity
+selectGrowthModel()
+report()
Generalisation
Species is superclass of tree
*
Tree
+age
+crownDiameter
+dbh
+firstBranchHeight
+calBasalArea()
0..*
1
neighbour
A.M.Fedorec 7/17/2015 2:35 AM
Compartment
+structure
+tciTreeDominance
+calcmeanBasalArea()
Association:
Each tree is associated
with many neighbours
1..*
Forest
+canopyDensity
+meanTopHeight
Aggregation:
Forest is composed of one or more compartments
Compartment is composed of zero or more trees
NEFIS Bonn0311.6
UML – Unified Modelling Language
Why?
• Visualising
• Specifying
• Constructing
• Documenting
• Users?
• Developers?
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.7
Why Use UML
• Problems of design and implementation –
partitioning up problem – defining interfaces,
assigning responsibility to components
• Problems of maintenance, portability,
futureproofing
• Bridging the gap between requirements and
implementation through modelling
• Traceable correspondence with XML, RDF and
OO programming languages such as Java
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.8
Software Issues
Functionality including Suitability, accuracy, interoperability,
compliance and security
Usability:
Understandability, learnability, operability
Maintainability: Analysability, changeability, stability,
testability
Portability:
Adaptability, replaceability, conformance,
installability
Reliability:
Maturity, fault tolerance, recoverability
Efficiency:
Time, resources
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.9
ISO 19119 GIS Mapping from Platform Independent UML Models
Platform
independent UML
User interface model
Platform
independent
UML model
Platform
independent UML
Processing model
Map to Web,
PC, PDA,
GUI…
User processing
services
Map to COM,
J2EE, CORBA,
Webservices…
Abstract
specification
Platform
independent UML
Information model
A.M.Fedorec 7/17/2015 2:35 AM
Human interaction
services
Map to RDB,
OODB, file…
Shared processing
services
Model/Information
management services
NEFIS Bonn0311.10
What is UML – Background
Traditional information system design:
• Static, structural architecture
• Dynamic, behavioural model
• Functional model
UML based on the “Object-oriented” paradigm
• Objects are instances of classes
• Objects have identity, state and behaviour
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.11
Algorithms - Dynamic
• Described functionally,
declaratively,
imperatively...
• Traditionally modelled
with control-flow,
data-flow or state
transition charts
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.12
Idno
TreeNo.
x
y
d
Ht
Hb
Ba
Vol
Ht/D
T
P
SubP
Lf
coll
N_Herb
Fam
Genus
Species
Gen_Spe
freq.
Sp_rank
Author
Gen_Spe
Total
Rank
N_Herb
coll
***
11101
1
9.9
0.7
16.2
9
6
0.020614662
0.061843986
55.55555556
1
1
1
1
-.
MORA
Artocarpus
elasticus
Art_ela
2
24
***_***
328
0
2
RIZ.
***
11101
2
6.2
2.8
12.6
6
4
0.012470598
0.024941196
47.61904762
1
1
1
1
RIZ.
124
DIPT
Shorea
assamica
Sho_ass
2
24
Act_gla
1
25
2
RIZ.
***
11101
3
5.4
4.8
13.7
10
8
0.01474305
0.049143498
72.99270073
1
1
1
1
HAS
531
RUBI
Neonauclea
calycina
Neo_cal
2
24
Act_glo
2
24
2
RIZ.
***
A.M.Fedorec 7/17/2015 2:35 AM
11101
4
6.1
7.5
13.9
9
5.5
0.015176646
0.045529937
64.74820144
1
1
1
1
RIZ.
125
DIPT
Shorea
ovalis
Sho_ova
20
6
Ade_mic
3
23
2
RIZ.
***
Data Models - Static
Problems of data quality traditionally
addressed with ER models
Study
Species
Species
Study
Permanent
Study Plot
Country
From Nell Baker, ATROFI report
NEFIS Bonn0311.13
The OO Paradigm (Static):
Objects have Identity, Attributes and Methods
Objects are associated with other objects
Identity
Attributes
Manager
Forest
manages 
budget
*
1
plan
adoptStrategy
canopyDensity
thin
grow
Methods
Association
uses 
GrowthModel
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.14
OO Dynamics: Objects interact via message passing
:Forest
:Manager
:GrowthModel
plan
getCanopyDensity
canopyDensity
adoptStrategy
thin
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.15
UML diagrams map to implementation
(e.g. Java code)
class Manager {
Money budget;
Forest nottingham;
proc void plan( ) {
Strategy strategy = new Strategy();
...
density = nottingham.getCanopyDensity();
...
stratergy = adoptStrategy(density);
...
nottingham.thin( );
}
proc Strategy adoptStrategy(float canopy) {
...
}
}
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.16
UML diagrams map to implementation – e.g. Webservices
Resource Description:
<rdfs:Class rdf:about=“&example;Manager” rdfs label=“Manager”>
<rdfs:subClassOf rdf:resource=“&example;Employee”/>
</rdfs:Class>
<rdf:Property rdf:about=“&example;manages” rdfs:label=“manages”>
<rdfs:domain rdf:resource=“Manager”/>
<rdfs:range rdf:resource=“Forest”/>
</rdf:Property>
Service Deployment and Discovery
<service name=“Manager” provider=“java:RPC”>
<parameter name=“className”
value=“uk.ac.gre.cms1.fa01.webservices.Manager”/>
<parameter name=“scope” value=“Application”/>
<parameter name=AllowedMethods”
value=“plan” value=“getBudget” value=“setBudget”/>
</service>
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.17
UML Vocabulary
“By relieving the brain of all unnecessary work, a good notation sets it free to
concentrate on more advanced problems, and in effect increases the mental
power”
•
A.N.Whitehead
• Things
Structural, behavioural, grouping, annotational
• Relationships
Association, Generalisation, Aggregation
• Diagrams
Class, object, use case, sequence, collaboration,
statechart, activity, deployment, component
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.18
UML Things
Classifiers:
Classes, interfaces, collaborations, use cases,
components, subsystems, nodes...
•
•
•
•
“Class-like things”
have attributes and operations,
can be described with a statechart diagrams
can participate in collaborations
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.19
Things in UML
• Structural:
• Classes, Interfaces, Collaborations, Use cases,
Active Classes, Components, Nodes
• Behavioural Things:
• Interactions (messages, action sequences)
• State machines
• Grouping things
• Packages (frameworks, models, subsystems...)
• Annotational things
• Notes
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.20
Stereotyping
• Allows you to create new kinds of building
blocks similar to existing ones but specific to
your problem.
• Rendered as a name enclosed in «guillemets»
placed above the name of another element or
as a new icon associated with the stereotype.
«Tree»
«Tree»
Cedar
Cedar
Cedar
Cedar
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.21
Standard Stereotyped Analysis Classes
• a class may only consist of methods with no
attributes, e.g. a program module such as a
resource discovery model – a controller class
• or may only consist of attributes without
methods, e.g. a database table such as
inventory data – an entity class
• a class may be a facade to a system, e.g. a
form, report or web page such as a
visualisation tool – an boundary class
• Classes of objects external to the system that
interact with it but need no further
specification, e.g. a forest manager – an
Actor
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.22
Example use of stereotyped classes
:Inventory
Selector
3: select and retrieve
:Report
Generator
:Forest
Manager
:Inventory
:Display
Report
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.23
UML Relationships
• Association
• Generalization
• Aggregation
• Dependency
• Realisation
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.24
UML Models
A model is a description of a system from a particular perspective
– a simplification of reality
• The choice of what models to create has a profound influence on
how a problem is attacked and how a solution is shaped
• Every model may be expressed at different levels of precision
• The best models are connected to reality
• No single model is sufficient. Every nontrivial system is best
approached through a small set of nearly independent models
• UML Models may be expressed textually or graphically
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.25
Modelling Architecture
The 4 + 1 View Model
vocabulary
functionality
system assembly
configuration mgt
Design View
Implementation
View
Use Case
View
behaviour
Process View
performance
scalability
throughput
logical
Deployment
View
physical
system topology
distribution
delivery
installation
Kruchten, P.B., The 4+1 View Model of Architecture, IEEE Software, Nov 1995, pp. 42-50
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.26
Models and Diagrams
Sequence
Diagrams
Communication
Diagrams
Statechart
Diagrams
A.M.Fedorec 7/17/2015 2:35 AM
Class
Diagrams
Use Case
Diagrams
Object
Diagrams
Component
Diagrams
Models
Activity
Diagrams
Deployment
Diagrams
NEFIS Bonn0311.27
UML Diagrams Cont’d
• Use Case Model
• Conceptual Class Model
• Communication (interaction)
Diagrams
• Deployment Diagram
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.28
Use Case Diagrams
«includes»
Use Service
«extends»
Locate Service
Client
Publish Service
A.M.Fedorec 7/17/2015 2:35 AM
Service
Provider
NEFIS Bonn0311.29
Identifying Classes in a Use Case
Use-Case Model
Analysis Model
«trace»
Use Service
Use Service
participant
Application
Interface
Service
Locator
Locator
Interface
A.M.Fedorec 7/17/2015 2:35 AM
Service
Implementation
ServiceInfo
NEFIS Bonn0311.30
Service-oriented Architecture
Directory
Publish
Locate
Service
Client
Bind and Communicate
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.31
Service Directory Class Diagram
Application
Directory
Publisher
+publish:void
+delete:void
+locate:ServiceInformation
+register:void
+update:void
ServiceInformation
Refers To…
ServiceImplementation
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.32
Message Passing
Collaborations between directory components
aPublisher:
Publisher
anApp:
Application
theDirectory:
Directory
1: «constructor»
service:
ServiceImplementationPublisher
info:
ServiceInformation
2: publish(info):void
3: locate():ServiceInformation
3.1: getInformation(info):void
4: createArchitectureAdapter(info):void
5: operation(): void
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.33
Deployment
Example: The Publish/Subscribe Pattern
aPublisher:
PublisherImp
l
Client
1: «constructor»
anEventService:
EventServiceImpl
aSubscriber:
SubscriberImpl
2: addSubscriber(String, String): void
3: publish(String, String): void
3.1: *[foreach(registeredSubscriber)] update(String, String):void
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.34
Deployment
Possible deployment scenario for the Publish/Subscribe pattern
UDDI Directory
EventService
Subscriber
Web Application
Subscribing Web
Application
EventServiceImpl
SubscriberImpl
Publishing
Application Node
PublisherImpl
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.35
Deployment – Further Example
PROVIDER SERVER
CLIENT
Resource
Browser
Analysis &
Reporting
Toolkit
NEFIS SERVER
*
«internet
»
Visualisation
Toolkit
Resource
Locator
*
«internet»
Metadata
Resource
Database
Catalogue &
Stds Ontology
Standardisation
Toolkit
NEFIS DATA SERVER
Harmonised
Database
Centralised
Data Warehouse
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.36
Summary
• Analysis and design essential to producing quality
systems
• UML is the de-facto standard for design and description
of system architectures and problem domains
• UML is a graphical modelling language based on the OO
paradigm
• Has limited but extensible vocabulary and grammar
• Diagrams provide different perspectives on static and
dynamic aspects of a system
• Elements in one diagram are traceable in other diagrams
A.M.Fedorec 7/17/2015 2:35 AM
NEFIS Bonn0311.37