-
-
Notifications
You must be signed in to change notification settings - Fork 197
AutomotiveExamplesForUmple
Kevin Brightwell edited this page Aug 26, 2015
·
1 revision
// Extended primitive type to support custom restriction
// Syntax suggestion 1
class myInt {
// Keyword type with an Umple primitive
type int;
// Set of constraints
restriction { min:0, max:10 }
}
// Syntax suggestion 2
primitive constrained0To10 { // could be extended beyond primitives
isA int;
[value >=0] [value <=10]
}
// Usage of above
class X {
// An attribute that implicitly has the above constraints
constrained0To10 y;
}
A concept is a set of methods that can work together
// Proposed syntax 1
class myConcept1 {
isA autosarType; // Extend a superconcept
method operation1 (int arg);
}
// Proposed syntax 2
concept myConcept1 {
isA autosarType; // Extend a superconcept
operation1 (int arg);
}
// Proposed syntax 3
interface myConcept1 {
concept;
isA autosarType; // Extend a superconcept
operation1 (int arg);
}
Defines a structure that is communicated between ports.
// Example syntax 1
class myComm1 {
data multiValt d1;
}
// Example syntax 2
class myComm1 {
isA customEvent;
multiValt d1;
}
// Example syntax 3
class myComm1 {
signal; // implies immutable, no associations (could be 'data', 'pure data', 'event',
multiValt d1;
}
serviceComp is a implemented component port type in another class
// Example syntax 1
class myApp {
// Component serviceComp will connect to me though my port 1
serviceComp -> port1;
ports {
// myconcept is my port through which other components can talk to me
myConcept1 port1;
}
}
// Example syntax 2
class myApp {
component; // means it would be 'active'; capable of communicating using channels
// myconcept is my port through which other components can talk to me
in port myConcept1 port1;
// could have in port, out port, in out port
}
// first class channel; could also inline as serviceComp -> port1;
channel ch1 {
serviceComp -> myApp port1;
}
// Example syntax 1
class myLatency {
// There would be a time out if there is excessive delay
latency {min: 0 sec, max 100 sec}
// If time out, do something, if exception, do something
flow { //behaviour }
}
// Example syntax 2
channel ch1 {
serviceComp -> myApp port1;
[latency > 0 && latency <=100]
flow { //behaviour } // needs defining in more detail
}
class X {
component; // active object
client; // initiates connections
server; // receives conn requests and est communications
}
- Wiki Home
- FAQ Frequently asked questions
- Examples
- Presentations
- PhilosophyAndVision
- Best practices for using Umple
- Publications and theses
- Tutorials
- Installing Eclipse plugin