29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Façade<br />

Figure 2-8 Model layer<br />

Model<br />

Please note that the model does not have any dependences on views or<br />

controllers.<br />

View<br />

The view layer implements a rendering of the model. The responsibility of the<br />

view is to know what parts of the model’s state are relevant for the user, and to<br />

query the model for that information. The view retrieves the data from the model<br />

or receives it from the controller, and displays it to the user in a way the user<br />

expects.<br />

Controller<br />

The controller’s responsibility is to capture user events and to determine which<br />

actions each of these events implies, depending on both the user’s and the<br />

application’s state. This usually involves verifying pre- and post-conditions.<br />

These actions can then be translated to messages to the model and view layers,<br />

as appropriate.<br />

Dependencies between MVC layers<br />

Figure 2-9 on page 32 shows the dependencies allowed in the MVC pattern.<br />

Note that the fewer dependencies your layers have, the easier it will be for the<br />

layers to respond to requirement changes.<br />

Chapter 2. <strong>Application</strong> design 31

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

Saved successfully!

Ooh no, something went wrong!