Peter Speltz wrote:
On 4/20/06, Dave Howorth <[EMAIL PROTECTED]> wrote:
Controller -- Handles apache request controls dictates flow.
Yup, and the Request is the instance data for a particular request.
Controller and Requet would be diffierent *types* or same type but
request is an instance of the controller?
Different types.
Presentation -- Presents the web interface to the model. Defines
actions, the uri base for this model, and form inputs (?). Sets
template variables. Delegates data manipulation to model.
Yup. Forms are a bit awkward (as usual :) The validation needs to be
done by the Model (because it's to do with data integrity in the model
and because you might want to carry out the same operation in a
command-line script). But the form itself must be part of the View (it's
HTML, for starters). That separation is another thing I need to do.
Yeah, l like using AsForm from the templates. However, I still cannot
get away from asking the model what type of input box a field needs.
Sure, you need to ask the model about the type of data a field represents.
I mean, it is the one that processes it and all so it has to know the
names of the inputs and what type of data to expect. And for select
boxes, if those were made in a template from raw data, what a mess the
templates would be. I tried it and said "Hell no" after 5 minutes.
Now in AsForm you can say
$sel_box = $c->to_field( $col => 'select', {items => $data_struct ,
selected => $id_or_data_struct});
and most of the common data structures -- cdbi objects, single array,
single hash, array of arrays (think selectall_arrayref) , array of
hashes are handled fairly well.
Yup. My templates have become more complicated as I've built my
application and I think that was a mistake. They should be as simple as
possible - simple for the user and the designer. Being able to take code
out of the templates is one factor in where I want to go with my
Presentation & Model separation as well.
Can you give an example of this ?
Well, I moved all the code that generated my list headers out of the
template into M::P::Path::URI, for example.
Cheers, Dave
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel