Edgewall Software

Changes between Version 13 and Version 14 of TracDev/ComponentArchitecture


Ignore:
Timestamp:
May 20, 2010, 11:45:22 PM (14 years ago)
Author:
Steven R. Loomis <srl@…>
Comment:

document components instantiating components

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ComponentArchitecture

    v13 v14  
    7575
    7676Direct `Component` sub-classes also do not need to worry about invoking the base classes `__init__` method (which is empty).
     77
     78=== Components instantiating other Components ===
     79
     80If one `Component` instantiates another, it typically will use the same `ComponentManager`, instead of creating a new `ComponentManager`.
     81
     82{{{
     83#!python
     84    class MyComponent(Component):
     85        def callOtherComponent(self):
     86            MyOtherComponent(self.compmgr).someFunction()
     87}}}
     88
     89Note that within trac, the component manager is more commonly referenced as `self.env`.
    7790
    7891== Declaring an extension point ==