velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick von der Hagen <patr...@vonderhagen.de>
Subject Re: Velosurf 0.5 released
Date Mon, 08 Jul 2002 19:07:15 GMT
On Mon, Jul 08, 2002 at 02:47:59PM -0400, Jeff Duska wrote:
> Isn't this a bad thing to do? Does this merge the Model, even some of 
> the controller functionality into my View. Wouldn't be better to use 
It depends. Personally, I can imagine examples where I would store some
information in a database which is only relevant for the view but of no
importance for my model.
Imagine a web-form asking you about your prefered operating-system. The
model has to know "there is this information and what ever I get back
shall be put in a database". In my database I will probably have a list
of possible values, so I can use foreign-key constraints to check for
validity.
Now I can a) hardcode the same information (which values are legal) in
my velocity-template, b) have my model find out about possible values,
put it in a datastructure and pass it to my velocity-context or c) have
velocity look up that kind of information itself in my database.
c) has its benefits, especially if my model works perfectly well without
this information.

We could argue now if the MVC-pattern is kept or broken. But patterns are
only informal rules and the most important think one should know about
rules can be learned from "the Matrix". You can bend them and you can
break them.

-- 
CU,
   Patrick.

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message