Use Cases and Controllers

In considering how we might map use cases to VB, one useful way is to map them to <<controller>> class stereotypes that are responsible for 'controlling' the overall use case and also responsible for the transaction as a whole.

(A <<controller>> class stereotype is a class that is mainly responsible for controlling and coordinating the implementation of a use case but doesn't actually perform any of the use case-specific detail, itself.)

Let's start by looking at a use case model of the example use case:

The use case will be performed by the following classes. Note the presence of the use case controller:

Ā«controllerĀ» TransferFunds

1 2

:: Account

This is a high-level model. The two accounts will be the source and target accounts.

As previously stated, the controller is just acting as a coordinator but also knows about the whole transaction. Therefore the lifetime of the controller is synonymous to the lifetime of the transaction and use case. When we discuss collaboration diagrams, we will show how the controller performs the use case.

Was this article helpful?

0 0
365 Days Of Motivation

365 Days Of Motivation

Stop Wasting Time And Learn How To Stay Motivated. Finally! Discover How To Stop Your Mind From Wandering, And Upgrade Your Motivation. You Can Hack Your Motivation Levels, Allowing You To Take Your Life To The Next Level.

Get My Free Ebook


Post a comment