I believe you could use http://trac.edgewall.org/wiki/TracDev/ComponentArchitecture to do this