application configuration

Now that we are done with an iteration of domain modeling, let’s see how we can configure a particular application for a specific set of requirements.

At the bottom of the page, we can see the complete model which combines final models from Parts I and II.

As the first step, we need to choose a jurisdiction, let’s say Canada except Quebec.

[ Canada && no Quebec ]

By constraints propagation, this configures advancedOrExtendedLeft and behind features for us.

Since we’re outside of Quebec, which requires horizontal, we still have a choice of orientation. Let’s choose vertical for our application.

Next, we learn that in Canada redAndYellowToGreen and allWayFlashingRedAsStop are not used but allWayYellow is used. We could explicitly assert that but since it’s a piece of knowledge we elicited during this application engineering, let’s contribute it back and add a constraint back to our domain model.

Now, we move on to the particular requirements of our application.

We now have to make a choice for the type of advancedOrExtendedLeft we want: leftArrow. Note that in a given jurisdiction, both options may be allowed; however, for a single application, at most one is allowed, which is why we must explicitly eliminate greenFlashing.

Let’s say that the dedicated right green arrow is not needed, so we eliminate it to reduce the cost.

The last choice is the countdownTimer, which we don’t need.

Let’s check the allowed states of our system in our application:



Module Statistics: | All clafers: 51 | Abstract: 1 | Concrete: 50 | Reference: 0 | Constraints: 73 | Goals: 0 | Global scope: 1..* | Can skip name resolver: no |

Module Downloads: | [.cfr] | [.html] |

We have now properly configured a single traffic light. Let’s focus on an application scenario with two traffic lights in opposite directions: next two traffic lights

Complete Model

Part I: Domain Features

TrafficLightSystem
Lamps
Red
Yellow
Green
LeftGreenArrow ?
RightGreenArrow ?
countdownTimer ?
[ no USA ]
redAndYellowToGreen ?
allWayFlashingRedAsStop ?
allWayYellow ?
[ no USA ]
or advancedOrExtendedLeft ?
greenFlashing
leftArrow
xor mountLocation
inFront
behind
xor orientation
vertical
horizontal
xor Jurisdiction
Europe
UK ?
mux NorthAmerica
USA
Canada
Quebec ?
Australia
NewZealand

Part II: Domain Concepts

TrafficLight
red : Lamp
yellow : Lamp
green : Lamp
leftGreenArrow : Lamp ?
rightGreenArrow : Lamp ?
arrowsOff ?
emergencyVehicle ?
xor TrafficSignals
[ emergencyVehicle => if allWayYellow then some allYellow else some warning ]
prepareToStop
[ red.off ]
[ yellow.on ]
[ green.off ]
stop
[ red.on ]
[ yellow.off ]
[ green.off ]
warning
[ red.off ]
[ green.off ]
prepareToGo
[ red.on ]
[ yellow.on ]
[ green.off ]
allYellow
[ red.off ]
[ green.off ]
abstract xor Lamp
on
off
flashing