On Thu, Oct 11, 2012 at 5:50 PM, ladd.james <
ladd....@gmail.com> wrote:
> maria.Controller.subclass(mynamespace, 'Controller', {});
>
> All my other project files refer to mynamespace.Controller rather than Maria
> directly.
> Like this:
>
> mynamespace.Controller.subclass(mynamespace, 'SearchController', {});
I agree and I consider this a best practice. It gives a nice place to
modify the behavior of Maria for the application.
In general, I always try to alias library namespaces into my own
project's namespace for a level of detachment from the library. For
example, in one project I created a function
mynamespace.renderTemplate that used one template engine. Later I was
able to switch to Mustache simply by rewriting the
mynamespace.renderTemplate function. In the future, if I want to
switch to another templating engine, I only have to worry about
rewriting mynamespace.renderTemplate. I don't have to go around the
app looking for all the many references to Mustache. Also if the new
engine requires a bit of a shim so it is compatible with something
Mustache specific that I used then I have a natural place to build
that shim: right in mynamespace.renderTemplate.
It is a good tip, James. Thanks for writing it up.
Peter