[development] Views - a tool for developers?

Barry Jaspan barry at jaspan.org
Wed Nov 21 20:48:51 UTC 2007


"Ryan Courtnage þÿ& " <ryan at courtnage.ca> writes:
> Now we are at the point where we need to start presenting lists of our
> custom content in various forms.  Teaser lists, title-only lists in
> blocks, among others.  For creating these lists, we have 2 options:
> direct use of db_query or use the Views module.

I think Views is great and, depending on your requirements, can
provide enormous added value.  For example, a client site that just
launched has a very nice search and index page
(http://7dvt.com/searchindex) built entirely around a single View in
one day.

That said, Views is not always the best choice.  If you have a complex
custom query that is not going into a contributed module (ie: it's
something custom to the site), it will be simpler to write it directly
than to indirect through Views.  It will also be more efficient.  From
a site/code maintenance point of view, it is much nicer to have a
query under version control than a View defined in your database.
Sure, you can export the view and check that it but the results are
larger, harder to read and edit, and just not as natural.

In my experience, clients/site admins do not use the powerful Views UI
to build or edit their own views, even though they can.  They have the
site designer or coder do that and the Views only change during major
site upgrades.  So the query-building UI ends up just being a longer,
more labor-intensive way of writing "SELECT ...".

The big payoff of Views, in my opinion, is not the query builder.
It's Arguments (especially in Summary or Show All mode), Exposed
Filters, and Style plugins (e.g. List, Table, Calendar, etc.).  If you
need Arguments or Exposed Filters, using Views will save you time. 

If you just want to use a style plugin... well, I lobbied Earl to
separate Views into two modules, Query and "List Display" or
something, so you could construct a custom query but still use the
Calendar display plugin, etc.  He didn't do that but says that Views 2
will allow something similar.

Hope this helps,

Barry



More information about the development mailing list