On Fri, Jun 1, 2012 at 3:45 PM, Iván Raskovsky <raskov...@gmail.com> wrote:
> Hi there, IMHO I think we are discussing two different topics here.
>
> The first one is documentation...
>
> The second one is the actual Generic CBV...

There's a third complaint that several people have mentioned that is
deeper than both these problems. This is that CBVs mask control flow
and this makes them inherently harder to use. Basically, since the
order of execution of your methods is an implementation detail of the
base class, everyone needs to refer to the documentation whenever they
try to examine a CBV.

This is somewhat related to the Generic CBV problem, in that a lot of
the people who ask "Why can't I do X with a Generic CBV" are really
asking, "Why isn't there a place to put what I need into the control
flow" and the answer is "Because when flow is inverted, every
extensibility point must be explicit." Adding more extensibility
points like multiple forms does nothing to fundamentally change this,
it just changes Generic CBVs from the 80% solution to the 90% solution
to the 95% solution, etc. They will never be a 100% solution,
precisely because control flow is inverted.

This problem is a really deep one, and has parallels with other
long-term sticking points in Django, such as the app model. Apps
provide a whole bunch of piecemeal functionality: some views, some
templates, some models, some tests, some urls, and these are all
executed and/or processed by Django based on its particular
implementation. For example, instead of reading the template from the
filesystem, you call a Django library function that reaches into its
global collection of loaded templates and retrieves it for you. In
CBVs, instead of calling validate() on some form, you rely on the
internals executing something for you, which makes understanding
preconditions for various methods difficult to understand without
extensive docs.

Anyways, this is a deeper problem than "There are two things we can
fix, let's get on that."

Best,
Alex Ogier

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

Reply via email to