Re:Django Vanilla Views 1.0 released.
by Daishiman on Monday September 23, 2013 @04:04PM
(#6433771)
The decorator can only add behavior prior to the original function's execution, and many decorators may not necessarily be applied together. CBVs allow a composition of mixins that can include behavior that's substantially more complicated and can deal with any of the methods and members defined for the view.
A well-defined base CBV allows you to limit the use of RequestContexts, checks for method types, and special validations. For small projects it may not make a difference; for projects with at least couple dozen views and a bunch of common behavior, they increase readability tremendously.
Also, they offer a very good template for defining view behavior. Once you're familiarized with CBV method definitions it's much easier to grok code, as the view flow is much more standardized than for regular function views.
A well-defined base CBV allows you to limit the use of RequestContexts, checks for method types, and special validations. For small projects it may not make a difference; for projects with at least couple dozen views and a bunch of common behavior, they increase readability tremendously.
Also, they offer a very good template for defining view behavior. Once you're familiarized with CBV method definitions it's much easier to grok code, as the view flow is much more standardized than for regular function views.