-
Notifications
You must be signed in to change notification settings - Fork 0
Api alignment #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Api alignment #20
Conversation
| * | ||
| * @author killing@leifos.de | ||
| */ | ||
| interface Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a friend of empty interfaces just for the purpose of having created such :-). But of course this is an approach/prototyp and maybe we need this kind of interface later.
| * | ||
| * @author killing@leifos.de | ||
| */ | ||
| class API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implements \ILIAS\API\Int\API?
| * | ||
| * @author killing@leifos.de | ||
| */ | ||
| class FactoryCollection implements I\FactoryCollection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of this factory stack created by the construction order of the factories, to determine parent/child relations when dispatching the command later on.
Maybe this should be renamed to FactoryCreationStack or something similar.
| * @param int $actor_id | ||
| * @throws Exc\PolicyFailed | ||
| */ | ||
| public function dispatch(Int\Command $command, int $actor_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When first reading this I had some pain to understand this, but know I got this!
I like this approach which is similar to ilCtrl/executeCommand/forwardCommand, so a handler could be used by different parent handlers (course AND group).
| */ | ||
| public function handle(API\Int\Command $command, int $actor_id) | ||
| { | ||
| if ($command instanceof AddCommand) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll most propably need to know something about the parent(s) (or certain information of this/them) in the current execution chain here. In the concrete case we maybe need to distinguish a course parent from group parent.
Update: Okay, AFAIK you already addressed this in the README.
Draft PR for API
README: https://github.com/leifos-gmbh/ILIAS/tree/api_alignment/src/API
Demo: https://github.com/leifos-gmbh/ILIAS/blob/api_alignment/src/API/demo/demo.php