Skip to content

Commit cec30d0

Browse files
committed
feat(developer): Document Consumable vs. Implementable OCP
Signed-off-by: Joas Schilling <[email protected]>
1 parent 67ef7cd commit cec30d0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_32.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ Removed APIs
3333
Back-end changes
3434
----------------
3535

36+
- OCP API split into consumable and implementable:
37+
For a more informed background see `RFC: Split OCP into Consumable and Implementable <https://github.com/nextcloud/standards/issues/15>`_ for more information.
38+
Short summary:
39+
40+
- **Consumable:** Interfaces, Enums and classes that have the ``OCP\AppFramework\Attribute\Consumable`` attribute, must only be consumed by apps and can not be implemented by apps themselves.
41+
This means the server side can extend the interface with new methods or reduce returned types of existing methods without it being consider an API break.
42+
However argument types of existing methods can **not** be reduced.
43+
Same rules apply to ``OCP\EventsDispatcher\Event`` that have the ``OCP\AppFramework\Attribute\Listenable`` attribute and ``Exception`` with the ``OCP\AppFramework\Attribute\Catchable`` attribute.
44+
- **Implementable:** Interfaces, Enums and classes that have the ``OCP\AppFramework\Attribute\Implementable`` attribute, can be implemented by apps.
45+
This means the server side can **not** extend the interface with new methods or reduce returned types of existing methods without it being consider an API break.
46+
However argument types of existing methods can be reduced.
47+
Same rules apply to ``OCP\EventsDispatcher\Event`` that have the ``OCP\AppFramework\Attribute\Dispatchable`` attribute and ``Exception`` with the ``OCP\AppFramework\Attribute\Throwable`` attribute.
48+
- **ExceptionalImplementable:** Despite not being implementable for all apps, some interfaces can have the ``OCP\AppFramework\Attribute\ExceptionalImplementable`` attribute indicating that they are implementable by a single app (or multiple).
49+
In those cases the general ``OCP\AppFramework\Attribute\Consumable`` rules apply, but the app maintainers or repository of named exceptions have to be informed during the PR process leaving them enough time to align with the upcoming change.
50+
51+
- These new attributes will be applied on a "defacto standard" basis to the best of our knowledge.
52+
In case an API was flagged unexpectingly, leave a comment on the respective PullRequest in the server repository asking for clarification.
53+
3654
Added APIs
3755
^^^^^^^^^^
3856

0 commit comments

Comments
 (0)