j2ee: Struts Model Components [22/27] ![]() ![]() ![]() |
The Model represents the internal state of the application (across page hits), and the various actions that can be taken on the system. Typically, this means integrating with a backend system, or a database, or an LDAP server, or an EJB. It could be just about anything that you could think of.
Struts uses the concept of an Action to interface with these components. Note that this doesn't mean that actions should contain all of your code, but the action is the Struts component that interfaces with your back-end code.
In general, your model should be developed using standard OO practices, and written using a component model that can be scalable, robust, secure, etc. For your purposes as a J2EE developer, this usually means either POJOs (Plain Old Java Objects) or EJBs, depending on your needs. The goal of Struts is not to model your specific environment and needs, but rather be a generic framework for web application development.