14

I'm relatively new to the features module and I've read contradictory recommendations online regarding whether it's easiest to maintain A) one big feature or B) several smaller features and then a "feature-controller" type module that lists all the smaller features as dependencies.

A bit about my specific situation: I'm using a local development -> dev server -> staging server -> live server workflow. This particular site will almost certainly be the only one of its kind that I ever develop; I do not intend to use the features I create for this site on any other sites.

This makes me lean toward doing everything in one big feature because I've had problems in the past where I accidentally defined the same rules in multiple features and gotten into trouble. However, in terms of structure this seems wrong to me-- there are different features/functions so they ought to be divided into separate features. On the other hand, I feel like by doing this I may just create additional work and overhead for myself that won't benefit anyone.

Which approach is easier to maintain in actual practice-- one big feature or many smaller ones?

1 Answer 1

7

Make several little Features, split by conceptual layer.

Advantages:

  1. Granularity when reviewing Overrides and performing Reverts — so you don't have to revert everything at once.
  2. Modularity — even if you don't plan to reuse individual components, breaking things down into discrete modules will help with maintainability.

For deploying a single site from development to test to production, we use the following taxonomy (where "site" is replaced with a unique machinename for the site) —

  • site_types Feature — declares Content Types, Fields, ImageCache settings, User Roles
  • site_structure Feature — declares Contexts, Views, Menus and Menu Links, Blocks, User Permissions, Variables
    • depends on site_types Feature
  • site_content Feature — declares Nodes
    • depends on site_structure Feature

If there are multiple distinct site sections (for example, Public vs Private), consider splitting things up further:

  • site_types Feature
  • site_structure Feature — declares structural components common to both Public and Private
    • depends on site_types Feature
  • site_public_structure Feature
    • depends on site_types Feature
  • site_public_content Feature
    • depends on site_public_structure Feature
  • site_private_structure Feature
    • depends on site_types Feature
  • site_private_content Feature
    • depends on site_private_structure Feature

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.