20.11.2013 Views

Use-Case Controller

Use-Case Controller

Use-Case Controller

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Use</strong>-<strong>Case</strong> <strong>Controller</strong> 7<br />

Structure<br />

The <strong>Use</strong>-<strong>Case</strong> <strong>Controller</strong> pattern defines five types of participants:<br />

<strong>Use</strong><strong>Case</strong><strong>Controller</strong>, Model, View, Extension and Inclusion.<br />

Class<br />

<strong>Use</strong><strong>Case</strong><strong>Controller</strong><br />

Responsibilities<br />

• Ensures the<br />

correct execution<br />

of an use case<br />

• Handles use case<br />

events from views<br />

and models<br />

Collaborations<br />

• View<br />

• Model<br />

• Extension<br />

• Inclusion<br />

An instance of <strong>Use</strong><strong>Case</strong><strong>Controller</strong> is an object that encapsulates<br />

the knowledge needed to ensure the correct execution of one<br />

particular use case specification: sequence of action steps,<br />

states, preconditions, post-conditions, and components, both for<br />

accepting user input and for performing system services.<br />

As a rule of thumb, one <strong>Use</strong><strong>Case</strong><strong>Controller</strong> will be designed for<br />

each use case. When a use case is started, one instance of the<br />

corresponding use-case controller is created to control the flow<br />

of the interactions involved. Depending on the size and<br />

complexity of the controller, one might decide to create several<br />

use-case controllers for a particular use case, or the opposite.<br />

A use-case controller is not intended to interact directly with<br />

either interface objects or system objects, but only to Model and<br />

View objects, thereby promoting some layering at use-case level.<br />

Class<br />

Collaborations<br />

Class<br />

Collaborations<br />

Model<br />

Responsibilities<br />

• <strong>Use</strong>-case<br />

<strong>Controller</strong><br />

View<br />

Responsibilities<br />

• <strong>Use</strong>-case<br />

<strong>Controller</strong><br />

• Provides system<br />

information and<br />

functionality<br />

needed during<br />

use case<br />

execution<br />

• Presents<br />

information to<br />

actors<br />

• Receives actors<br />

input<br />

A use-case controller is typically associated with a Model facade,<br />

through which it has access to the subset of data and<br />

functionality needed to perform system-related actions. On the<br />

other hand, to communicate with the actors, a use-case<br />

controller relies on View facades. A View is usually an<br />

aggregation of several interface objects, such as windows, menus<br />

and buttons, dialogs and communication protocols.<br />

Copyright © 2001 Ademar Aguiar, Alexandre Sousa and Alexandre Pinto.<br />

All rights reserved. Permission granted to copy for all purposes of EuroPLoP’2001.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!