Forum OpenACS Development: Re: .LRN callback for member approval
And instead of putting it where you've suggested, I'd suggest the "change_state" proc inside acs-tcl/tcl/membership-rel-procs.tcl.
My preference is for a minimum of callbacks generalized to be as useful as possible, rather than creating a single specific callback for a particular need you have at a particular moment.
Going with your suggestion would mean, that a developer who wants to make an extension as I need it, to look at this procedure, look at the underlying procedures, and find the callback. Once done, he needs to write some code, which, given a rel_id will look:
- is this rel_id present in dotlrn_member_rels_full for every relationship change in a relationship within the system.
- if it is a rel_id that belongs to a dotlrn_member_rel, get the community_id and the user_id.
For me the fundamental issue is, if we are supposed to drill down to the lowest sensible level when adding callbacks, it will make it much harder to read the code and will cause detecting side effects much more difficult. This is why I would limit the scope of a callback and have many of them instead of having a large scope for a callback but just a few.