Hi Mark

On Wed, 2008-10-22 at 22:35 -0400, Mark Rajcok wrote:
> On Tue, Oct 21, 2008 at 7:45 PM, Ron Savage <[EMAIL PROTECTED]> wrote:

[snip]

> > But why /exactly/ is it growing?
> 
> 
> Ron, I wasn't too clear about who I was quoting. Richard Jones had the
> growing Model class, so he would need to answer that question.

Oops. My mistake.

[mega-snip]

> If it wants person data, it calls Database.pm's some_method() to get a
> > data structure, which then gets formatted into either HTML or JSON.
> 
> 
> So if you need more than one Person (object), you'd have to create a
> some_other_method() in Database.pm.  Sounds like a lot of methods in
> Database.pm might pop up over time.

Ah, but at this stage I don't ever have more that one Person object.

A search will return an array of of hash refs, each hashref equivalent
to a Person object, i.e. holding personal data, without quite being a
fully-blown object. Not much different, really.
 
[snip]

> I like having HTML template files and separate model classes... for this
> reason:  if I add a new field to the User table, then normally only the
> "add/edit" user HTML template and the User.pm class need to change.

Right. I use HTML::Template. So a new field requires a template change
of course.

But it also requires changes to the validation code, and probably the
save code.

It just so happens that for a small app I have my save code in my
database module, but yes, I could split it out if the complexity per
object grows.

> I have not started thinking about how I'm going to do table joins yet.  I
> may end up with a Database.pm-like class for that...

'Joins'? Damn - another thing I have to read up on on WikiPedia :-)).

-- 
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html



#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to