Models

malte on 2003-04-02T10:58:36

Models are subclasses of ENGINE::MVC::Model. They may choose to reimplement the init() method that is called upon instance creation (on every request). A model has a controller. It has no idea about its views.

A model implements an interface. An unlimited number of views may make use of that or a subset of that interface. Models usually implement the Facade design pattern. You can see model as a _view_ on your business objects, whatever they may be.

Models and views form an nxm relationship. There may be n views displaying a single model, and there may be m models being displayed by 1 view. A typical gui application (website) usually has multiple views that share common background functionality, so you save a lot of work here.

This kind of total separation of presentation- and business logic makes it very easy to separate the two parts into independent work processes.


Just a Thought,...

Dom2 on 2003-04-02T11:38:59

But have you seen Apache::PageKit, which purports to be a very similiar design? I haven't used it, but it seems to be based on an MVC approach.

-Dom

Re:Just a Thought,...

malte on 2003-04-02T12:37:48

Indeed, PageKit has a similar approach. PageKit has the extra advantage of being released. So, if you want to use an MVC system now you are much better off with PageKit.

Software is not the point, though. At least my system wasn't terribly hard to implement. The development Process is much more important assuming that you can't sell your customer something that's already done.

Don't mistake ENGINE::MVC with a kitchen sink. It won't program your website. It doesn't provide much functionality at all. All it does is providing the programmer with a way to do things, so he can keep his head focused on actually implementing things.