[openbiblio-dev] [ckan-dev] coding style
David Read
david.read at okfn.org
Wed Jan 26 20:59:03 UTC 2011
Will,
I think where there is such a wide practice of projects happily using
static / class methods (as you've noted), there are more important
things we can spend our time discussing and improving. Such as running
untested code in production, bugs not being tracked and unrun/failing
auto-tests.
Dave
On 26 January 2011 19:11, William Waites <ww at styx.org> wrote:
> * [2011-01-26 17:50:10 +0000] James Gardner <james at 3aims.com> écrit:
>
> ] I've never had to resort to @classmethod in my own code - helper
> ] functions are fine.
>
> It's used in much OKF code in what I consider an anti-pattern,
> putting factory methods like create(), get(), save etc. on
> classes meant to represent instances. This is typically model.Foo.
>
> Notice that sqlalchemy does this with utility functions and
> classes, e.g. the session. Django gives the objects a factory
> class called Manager.
>
> I think that in general @classmethod should only be used if
> there is a very good reason.
>
> As far as changing and fixing these various things I agree they
> are best done incrementally as we find them in the course of
> doing other things, it is way too big a job to change everywhere
> (especially considering that this covers ckan, wdmmg, bibliographica
> in my direct experience and probably all the different openshakespeare
> opencorrespondence, etc. things)
>
> Cheers,
> -w
> --
> William Waites <mailto:ww at styx.org>
> http://eris.okfn.org/ww/ <sip:ww at styx.org>
> F4B3 39BF E775 CF42 0BAB 3DF0 BE40 A6DF B06F FD45
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
More information about the openbiblio-dev
mailing list