Changes between Version 12 and Version 13 of TracDev/ComponentArchitecture
- Timestamp:
- Jul 25, 2009, 11:14:56 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/ComponentArchitecture
v12 v13 164 164 ''Note that `trac.env.Environment` inherits `trac.core.ComponentManager`, so you'll typically see components initialized with an environment.'' 165 165 166 These are the first few lines of `PermissionSystem` as of r5790 (or [browser:trunk/trac/perm.py :r5790#L230 in context]):166 These are the first few lines of `PermissionSystem` as of r5790 (or [browser:trunk/trac/perm.py@5790#L230 in context]): 167 167 {{{ 168 168 #!python … … 177 177 Note that this `Component`: 178 178 1. implements the `IPermissionRequestor` interface 179 1. has an extension point for registering all the Components implementing `IPermissionRequestor` ([browser:trunk/trac/perm.py :r5790#L40 in context]):179 1. has an extension point for registering all the Components implementing `IPermissionRequestor` ([browser:trunk/trac/perm.py@5790#L40 in context]): 180 180 {{{ 181 181 #!python … … 192 192 In this specific case `PermissionSystem` will be part of that list as well, because it implements the `IPermissionRequestor` interface. In no way a Component is bound to implement the interfaces it declares an extension point for, the two operations being entirely independent. But when that make sense, it's entirely possible to do so. 193 193 194 ''Note: it's certainly debatable whether it makes sense in this particular case—but if you '''do''' decide to do it, watch out for infinite recursion as `PermissionStore` does [browser:trunk/trac/perm.py :r5790#L380 here].194 ''Note: it's certainly debatable whether it makes sense in this particular case—but if you '''do''' decide to do it, watch out for infinite recursion as `PermissionStore` does [browser:trunk/trac/perm.py@5790#L380 here]. 195 195 196 196 Next in `PermissionSystem` there is a declaration of an `ExtensionOption` called `store`: