Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

A component "grade" is a form of type definition: a name for a particular collection of default configuration options. When defining the functionality of a component, sometimes a grade is appropriate, sometimes a subcomponent is appropriate.

When should you use grades, and when should you use subcomponents?

  • If your top level component is better thought of as a collection/union of several things, use subcomponents.
  • When it's a general facility you want useful throughout the component, use a grade. (Your top level component will be polluted by everything in the grade. If that's ok, then use a grade.)

The question "When to use grades, when to use subcomponents?" is similar to "When to use inheritance, when composition?" and can be answered by the same 'has a'/'is a' comparison:

  • has a = subcomponents
  • is a = grades