Community defined extension interfaces

I’ve seen a very cool approach called Roma Metaframework. To my understand The idea behind this framework is, to strongly decouple to concrete implementation of extensions from the functional description what the extension provides. All the extensions are defined as abstract interfaces, e.g. GUI, RBAC, etc. Then existing modules can be adapted to this interfaces or new modules can explicitly written to implement this interfaces. If an other module uses e.g. RBAC, it only uses the interface methods and does not need to know anything about how the actions are performed. The RBAC component is exchangeable and could be replaced by any other RBAC component implementing the same aspect interface.

Lets give an example of my idea of adaption for Yii:

Every application we wrote with Yii needed a user component of some sort. We should have an interface of what this user interface provides to the outer world. This could be a username, an e-mail adress and input methods creating and saving a new user object.

A second aspect interface would be RBAC that has a dependency on the abstract User, because it needs the unique user id to attach the configured roles to. Other modules could have dependencies to the RBAC aspect telling the RBAC components about the possible actions they provide. On call of this actions, these other modules would ask RBAC if the action is allowed. The RBACs duty would be to provide the GUI to create Roles and map them to actions. Furthermore to answer the question, if a certain user may do a certain action.

The additional value of having defined the RBAC component as an abstract interface is, that several extensions could implement it. For testing reasons we could easily switch between all the available RBAC extensions and choose the one, that fits our needs best. E.g. one RBAC could provide an interface for administration, another RBAC would use code generated config files from an external application or something. We only would have to read and understand the RBAC interface once.

Hope I was able to explain my ideas, I would be happy about discussion.

Kind regards,


Do you mean something like this: ? If yes, then it has nothing to do with the framework itself.