Yii Framework Forum: Community defined extension interfaces - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Community defined extension interfaces

#1 User is offline   Bergtroll 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 20-August 09

Posted 13 April 2012 - 05:35 AM

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,

Bergtroll
0

#2 User is online   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,778
  • Joined: 17-January 09
  • Location:Russia

Posted 14 April 2012 - 01:58 PM

Do you mean something like this: https://github.com/s...pp/modules/wiki ? If yes, then it has nothing to do with the framework itself.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users