-- keith Pope <[EMAIL PROTECTED]> wrote
(on Tuesday, 11 November 2008, 03:30 PM +0000):
> Thx Matthew your bug app example is just what I needed :) You even get
> nicely namespaced models that way too.
> 
> Just a quick question about your model unit tests, it seems from
> looking at the source you use a real db connection is this correct?

I use sqlite for testing. This way I can have separate test data from my
development or production data, and can control what data is present for
the tests.

> I was having trouble trying to test with Zend_Db_Table so I have
> further abstracted my model so that I can replace tables with test
> objects.

I almost went this route, but a test database was faster to implement.
:)

> I am just checking, just incase I missed some functionality in Zend_Db_Table
> 
> Thx for the help, nice work on the Loader optimizations btw.
> 
> keith
> 
> 2008/11/11 Matthew Weier O'Phinney <[EMAIL PROTECTED]>:
> > -- keith Pope <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 11 November 2008, 01:39 PM +0000):
> >> I am just wondering what the recommended way to load models is.
> >>
> >> 1) Add model directories to the path and use Zend_Loader
> >> 2) Use the Plugin Loader
> >>
> >> I ask as there has been discussion on speed and the differences
> >> between ZL and PL, I was wondering what the most efficient out of the
> >> two.
> >
> > You're going to have potential inefficiencies with both.
> >
> > If you go for (1), then if your app grows, you'll start adding paths for
> > each module, and the larger your include_path grows, the more liklihood
> > of naming conflicts and the more inefficient the lookups will become.
> >
> > If you go for (2), you'll have a performance decrease right off the bat
> > -- but you can alleviate most of that with the new PluginLoader include
> > file cache that ships with 1.7.0. You can also then prefix your classes
> > per-module.
> >
> > I personally usually go with (2), and you can see an example of how I
> > approach it in the bugapp demo I wrote for the DPC earlier this year:
> >
> >    http://github.com/weierophinney/bugapp
> >
> > In that, I use an action helper that uses an internal PluginLoader to
> > grab models. (Helpers are in application/controllers/helpers/)
> >
> > --
> > Matthew Weier O'Phinney
> > Software Architect       | [EMAIL PROTECTED]
> > Zend Framework           | http://framework.zend.com/
> >
> 
> 
> 
> -- 
> ----------------------------------------------------------------------
> [MuTe]
> ----------------------------------------------------------------------
> 

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to