IN THIS CHAPTER
The model is the least tightly defined piece of the Struts MVC architecture, and for good reason. Models, by definition, are used to control access to the tangled world of business logic ”all the stuff that isn't display or control flow, but comprises the actual mechanisms of what happens underneath. Because of this, the model can be composed of just about anything at all. For example, it may be made up of any or all of the following:
As far as Struts is concerned , it's the job of the Action to perform whatever communications are required with the model. So, in one sense, this could be a very short chapter: "Write your models and hook them up to the Action ." You don't get off quite that easily, however. Before moving on, there are a few words to be said about designing models using best practices. This chapter will attempt to illustrate a few of them. |