Is there any way that a role can be removed after being assigned to a object?
In my case, I would like to have a role assigned to an object, but during the course of the script, my roles for the particular object need to be modified. I want to remove the earlier role and add a new role to the object. Is there a way to do this? | [reply] |
This sounds like horribly bad design.
You haven't told us what problem you are trying to solve by this approach, but from my perspective, it looks as if your approach would be far better served by an object A that has another object B, which gets removed or replaced by a third object C if its behavirour needs to change:
A -> B
# Change behaviour:
A -> C
Maybe, B and C can implement some roles, but the interface of A should remain identical and delegate to its worker, B or C. | [reply] [d/l] |
| [reply] |
Is there any way that a role can be removed after being assigned to a object?
In my case, I would like to have a role assigned to an object, but during the course of the script, my roles for the particular object need to be modified. I want to remove the earlier role and add a new role to the object. Is there a way to do this?
| [reply] |