Edgewall Software

Changes between Version 20 and Version 21 of TracDev/ComponentArchitecture


Ignore:
Timestamp:
Nov 21, 2010, 5:58:44 PM (13 years ago)
Author:
Sebastian Krysmanski <sebastian@…>
Comment:

Added documentation about ways of defining an extension point

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ComponentArchitecture

    v20 v21  
    119119
    120120The `TodoList` component notifies the observers inside the `add()` method by iterating over `self.observers` and calling the `todo_added()` method for each. This works because the `observers` attribute is a [http://users.rcn.com/python/download/Descriptor.htm descriptor]: When it is accessed, it finds all ''enabled'' components (see [#component_lifecycle below]) that declare to extend the extension point. For each of those components, it gets the instance from the component manager, potentially activating it if it is getting accessed for the first time.
     121
     122Note that there are actually three ways to define an extension point:
     123
     124 * `trac.core.ExtensionPoint`: This is an ''unordered list of all'' enabled components implementing a specific extension point interface.
     125 * `trac.config.ExtensionOption`: An option for [wiki:TracIni trac.ini] that describes ''exactly one'' enabled component implementing a specific extension point interface.
     126 * `trac.config.OrderedExtensionsOption`: An option for [wiki:TracIni trac.ini] that describes an ''ordered list'' of enabled components implementing a specific extension point interface. (Components that also implement the same interface but are not listed in the option can automatically be appended to the list.)
    121127
    122128== Plugging in to an extension point ==