29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

► You may have more than one view of the same model. If both the business<br />

logic and its presentation were built together, adding an additional view would<br />

cause considerable disruptions and increase the component's complexity. A<br />

good example of a model with two views would be a banking application that<br />

can be accessed through both the Internet and mobile phones.<br />

► You do not want to have to change the model every time you modify the view.<br />

The view is definitely dependent on the model, since it presents specific<br />

aspects of the model to the user. It makes no sense, however, to have the<br />

model depend on the view. Building both together dramatically increases the<br />

chances of this happening, and of you having to change the model every time<br />

you implement a small change to the view.<br />

This separation can be achieved through the layering of the component into:<br />

► The model layer, responsible for implementing the business logic.<br />

► The view layers, each responsible for rendering the user interface (be it<br />

graphical or not) to a specific client type and in a specific fashion.<br />

With these two layers, we can implement the business logic and present it to the<br />

user. That solves only half of the problem. We would also like to be able to<br />

interact with the model. The implementation of this interaction is better left to a<br />

third layer, called controller.<br />

This model-view-controller structure has several benefits:<br />

► You can isolate development effort to some extent, so that implementation<br />

changes in one part of the Web application do not require changes to another.<br />

The developers responsible for writing the business logic can work<br />

independently of the developers responsible for the flow of control, and<br />

Web-page designers can work independently of the developers.<br />

► You can more easily prototype your work. For example, you might:<br />

– Create a prototype Web application that accesses several<br />

workstation-based programs.<br />

– Change the application in response to user feedback.<br />

– Implement the production-level programs on the same or other platforms.<br />

Outside of the work you do on the programs themselves, your only<br />

adjustments are to configuration files or name-server content, not to other<br />

source code.<br />

► You can more easily migrate legacy programs, because the user interaction is<br />

the same wherever those programs run and however they interact with data<br />

stores.<br />

► You can maintain an environment that comprises different technologies<br />

across different locations.<br />

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

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

Saved successfully!

Ooh no, something went wrong!