On Wed, Sep 22, 2010 at 4:26 AM, klaasvanschel...@gmail.com
<klaasvanschel...@gmail.com> wrote:
> tl;dr
> * Django Apps Suck. Your reply explaining why they don't is expected.
> * Reuse of a lot of things doesn't suck. But the specific unit app,
> meaning a bunch of models that can be modified and presented with
> their model-specific features, is extremely hard to reuse.
> * Apps are mostly hard to reuse because they are hard to reuse with
> minor modifications (extensions).
> * Using decorators on views to define authorization levels ties in
> said authorization levels with the app (and makes it non-reusable)
> * The hardest things to change are at the bottom of Django's call
> chain. Deep inside the views, we find particular Models, Forms and
> references to other views.
> * Models are extra hard to change, because they are expected to be non-
> abstract in the app.
> * There is no logical separation (dir structure) between "a reusable
> app" and "my modifications to a reusable app".
> * Settings.py is not a solution (it is a problem), though I don't
> bother to explain why.
> * Some ideas for solutions exist, but this seems to be an open problem
> in the Django world.
> Correct me if I'm wrong.

I'm no sure I'd go so far as to say your 'wrong' -- you've certainly
got some valid points in here -- but you're drawing a different set of
conclusions than I do.

You're looking at the world of Django apps that has evolved over 5
years, and is still evolving, and has an evolving world of best
practice, and appear to have concluded that reusable apps can't/don't
work.

I look a the same landscape and see that reusability demonstrably
*does* work -- but it could work a whole lot better. More importantly,
I've seen reusability get steadily better over time as the community
gets more experience building larger projects, and needing to reuse
more code.

Reusability has always been *possible* -- providing you build your
apps in the "right way". The catch is that not every app is built the
"right way"... and the understanding of the what constitutes the
"right way" changes with time. Even Django's contrib apps have been
victim of this. contrib.comments was built using the best
understanding of it's time, and landed in Django 1.0. By Django 1.1,
we had significantly improved our understanding of the importance of
having multiple instances of an application, and provided tools to
allow URLs to be namespaced and handled at a class level.

Does this mean that contrib.comments isn't reusable? Well, yes an no.
It *can* be reused. It has many desirable reusable features. It can
and has been used in many projects. But it isn't 'state of the art'.
And there is a of aspects of reusability that could be improved in
that app.

The secret is that someone needs to pitch in and make those
improvements. You think contrib.comments isn't reusable enough?
Propose a change! Make your case, write a patch, shepherd it through
the release process.

The same goes for any other reusable app in the community. If you find
an app that isn't as reusable as it should be, contribute a patch back
to the authors that adds flexibility in the direction you think it
needs it.

And if there's something that needs to be acknowledged at the core
level to improve support for reusability, we're all ears. Namespaced
URLs was a big step. Class based views will be another -- they've been
on the roadmap since 1.0, and based on progress so far, there is a
good possibility we might actually get them for 1.3.

At the end of the day, I can only see four possible reasons why an app
can't be made reusable:
 a) fundamentally can't
 b) can't justify the engineering cost to do it
 c) can't work out how to do it, or
 d) can't be bothered

I'm yet to see a genuine case of (a) -- every time I've seen (a), it's
really masked version of (b), (c) or (d).

(b) is a legitimate engineering management problem that can't be
ignored, so anything Django as a project can do to lower the cost
barrier is certainly a welcome suggestion.

(c) is an education problem; Admittedly, we haven't been as good at
this as we have in other areas. There are various unofficial resources
and books that discuss reusability, but there's nothing in Django's
formal documentation corpus on this significant problem. Pinax started
as an attempt to identify and codify some of the conventions that
would lead to better reusability in apps. However, that hasn't really
resulted in a concrete set of guidelines, more a set of best practices
best observed by inspection. I completely agree that this is something
we need to address; volunteers are welcome.

(d) is a motivation problem. Maybe it's driven by (b) and (c), but
ultimately, we can lead a horse to water, but we can't make it drink.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to