On 11/18/05, Peter Speltz <[EMAIL PROTECTED]> wrote:
> On 11/18/05, Dave Howorth <[EMAIL PROTECTED]> wrote:
>
> > > I didn't need $r for that, can't imagine why you would need access to
> > > any request variables.
> >
> > Because $r isn't the request. It's the controller :) Sure, it contains
> > request variables. But - and I'm guessing here - more important in
> > Peter's case is that it (and only it) contains the config. So in the
> > model, you have to have $r to access config. Which is broken, IMHO.
> >
>
> I cant think yet. slow morning. But  my point was simply  the only
> interface to get the class of a particular table requires you have the
> Maypole request object, $r.
>
> Not only do i often not have $r when I want a class of but I also
> never think of putting it in arg list.  But i am getting the hang of
> that.
>
>

class_of() is in completely the wrong place, and it's going to make it
awkward to implement multiple models (which isn't near the top of my
list, but it's on there somewhere). Anyway, class_of needs access to
the request/controller, because the mapping information is held in the
config object (either as a hash, in ::Model::CDBI::Plain, or via a
method call on the loader object under Model::CDBI. It's the model
that is irrelevant. So class_of() should be a request/controller
method, not a model method.

d.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel

Reply via email to