Chapter 9. Model Components: Modeling the Business


IN THIS CHAPTER

  • Well-Designed Models

  • Further Isolation Techniques

  • Conclusions

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:

  • A JDOM parser talking to an XML file

  • A JNDI implementation communicating with an LDAP server

  • An EJB stub communicating to an EJB server

  • A SOAP client communicating with a remote Web service

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.



Struts Kick Start
Struts Kick Start
ISBN: 0672324725
EAN: 2147483647
Year: 2002
Pages: 177

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net