D
David Sharp
When you're constructing an application, do you envision the model as a
persistent monolithic entity that represents the current application
state? Or do you envision the model as an transient entity, related
only to the current page (resulting in one model per page).
Until recently, I've always thought of the model as the current overall
application state (as expressed by the database), and the web pages were
all simply methods of manipulating that state.
More recently, however I've come to realize that there is some merit to
thinking of the model as being a transient entity that exists simply to
move data back and forth between the controller, sort of a form backing
bean on steroids.
In the first case, the model exists as a set of interrelated data
records in the database. In the second, the model is created by the
controller to communicate with the view.
So I'm looking for some input from some programmers as to how they
envision the "model" in an MVC application. Maybe there is yet another
way of defining it that I haven't thought of.
Anyhow, I appreciate any feedback.
Dave
persistent monolithic entity that represents the current application
state? Or do you envision the model as an transient entity, related
only to the current page (resulting in one model per page).
Until recently, I've always thought of the model as the current overall
application state (as expressed by the database), and the web pages were
all simply methods of manipulating that state.
More recently, however I've come to realize that there is some merit to
thinking of the model as being a transient entity that exists simply to
move data back and forth between the controller, sort of a form backing
bean on steroids.
In the first case, the model exists as a set of interrelated data
records in the database. In the second, the model is created by the
controller to communicate with the view.
So I'm looking for some input from some programmers as to how they
envision the "model" in an MVC application. Maybe there is yet another
way of defining it that I haven't thought of.
Anyhow, I appreciate any feedback.
Dave