Monday, April 30, 2012

Feature Driven Development : Distros

Moving the database settings from one one instance to other, has always been a menace. Not just in Drupal but web-development in general. Thanks to features module we today have solved this problem significantly if not completely.

A feature is a collection of Drupal entities which taken together satisfy a certain use-case. And what features module does is enables the capture and management of features in Drupal. A features module takes different site building components from modules(with exportables) and bundles them together in a single feature module. Examples of modules with exportables are views, cck, contexts and panels. So in simple terms features bundles together the varoius components from modules like views, cck, contexts and panels.

To get more clarity lets take an example. Let us assume that we are exporting a “Photo Gallery” feature through features module. The “Photo Gallery” feature will typically consist of two content types images and gallery, a view for latest galleries, a view for images in the gallery and a view for the featured gallery. Three to four image-cache presets. Few admin settings. So it would be a herculean task to export all these features individually. With features when you select one items it autosuggest all the other realte entities that should be exported. Using contexts simplifies this process further more.

With the advent of features module, a new trend has started in the Drupal Distro space and its called Features Driven Development. The idea here is to keep the naming convention generic enough so that all you need to create a new Distro is export your features through feature module and create a simple profile with the modules exported by feature enabled by default. Thanks to features module every Drupal developer can now also be a Distro contributor, if he can generalise the requirements. A whole new set of Distros or built base don this concept.