On Mon, Dec 5, 2011 at 10:07 AM, sebastien piquemal <seb...@gmail.com> wrote: > Could you post a link to a place where class-based views are being > criticized ? And also in what sense are they convoluted ?
i have previously expressed some problems with CBVs, maybe not so solid as criticism; but i understand the point of view of calling them 'seemingly overcomplex'. i think the problem is that a classical Django view fits a very procedural niche: generate the response for this request. seems almost like the definition of a function, no? therefore using OOD to get better modularity _inside_ this specific niche is far from obvious. Right now, the CBVs are documented only in the 'what they do', but not in the 'how to use', nor in the 'why are they like that'. In the end, i had to read lots of class definitions, keeping track of what is implemented at what level to see which class to use, whether to instantiate or inherit it, and where to override what; all the while thinking that I wlaready knew how to do that with the old generic views. in some cases, after i had it working with CBVs, when i had to extend functionality a little more, i finally wrote a classic view function instead. Does that mean that they're overly complex? maybe Would a simpler design be easier to use? sure, but only on the simple cases Does the current design holds up for the complex cases? i don't know, but hope so. For me, that's the real problem. without the 'how to use' docs, i don't have any hint about when to make the effort to stay with CBV (to learn them better) and when to write case-specific code. -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.