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.

In the following sections, we discuss some of the properties of each of these<br />

layers.<br />

Model<br />

The model layer manages the application domain’s concepts, both behavior and<br />

state. It responds to requests for information about its state and responds to<br />

instructions to change its state.<br />

Just like any software component, the model should have a public interface that<br />

is well defined and as simple as possible. This is usually achieved through the<br />

use of a facade. The intent of facades is to provide a simple and unified interface<br />

to the otherwise complex model that lies behind it. By doing so, we reduce the<br />

dependencies between the model classes and its clients. Fewer dependencies<br />

means more freedom to adapt to new requirements.<br />

Note: Facade is a documented design pattern. For more information, refer to<br />

Design Patterns: Elements of Reusable Object-Oriented Software.<br />

As an example, consider an appliance with which you are certainly familiar: a<br />

television set. You will probably agree that changing TV channels is quite a<br />

simple task. Now ask yourself these questions:<br />

► Do you know how the television set represents channels internally?<br />

► Do you know exactly what goes on when you change TV channels?<br />

► Do you think you should know these things?<br />

Chances are that you have answered no to all of the questions above. What is<br />

the advantage of not knowing how TVs represent their data and implement their<br />

operations? You could buy a new TV, which does these things internally in a<br />

completely different way, and you could still change channels.<br />

Figure 2-8 on page 31 shows the model layer with its encapsulated business<br />

domain objects and the exposed facade object.<br />

30 <strong>IBM</strong> <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> - Express V5.0.2 Developer Handbook

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

Saved successfully!

Ooh no, something went wrong!