On Thu, Dec 1, 2011 at 11:17 PM, lyn2py <lyn...@gmail.com> wrote:

> Model files are run on every request - does that mean having a complex
> database structure would slow the entire site down?
>

Yes, if you everything you have in models will be executed even if you are
just serving a simple contact form or an small string in ajax callback.

For solving this you can use submodels (subfolders in models which maps to
the requested controller/function) or you can create your system in modules
and import only what you need explicity in every controller/function you
create.

I think submodels are for small apps because it does not permits the reuse
of submodels for multiple controllers. I prefer to code in /modules

an example of the approach:  https://github.com/rochacbruno/Movuca (the
sample app running http://labs.blouweb.com/movuca2/home/index)

Specially if the application are being created to run on Google App Engine,
where CPU costs a lot.


-- 

Bruno Rocha
[http://rochacbruno.com.br]

Reply via email to