[ 
https://issues.apache.org/jira/browse/SLING-2993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Felix Meschberger updated SLING-2993:
-------------------------------------

    Attachment: SLING-2993.patch

Proposed patch:

* All classes intended for extension remain unchanged
* All classes not intended for extension are marked final
* All interfaces intended to be implemented by multiple bundles (providers) are 
marked @ConsumerType
* All interfaces intended to be implemented by a single bundle are marked as 
@ProviderType

The promise is, that changes to @ConsumerType marked interfaces required an 
update to the major version of the exported package while changes to 
@ProviderType marked interfaces require an update to the minor version of the 
exported package.

The other way around: Implementors of @ConsumerType interfaces do not have to 
be fixed when new API is added or some @ProviderType interface is changed. 
Implementors of @ProviderType interfaces have to be adapted when those are 
changed.
                
> Properly tag and annotate interfaces and classes
> ------------------------------------------------
>
>                 Key: SLING-2993
>                 URL: https://issues.apache.org/jira/browse/SLING-2993
>             Project: Sling
>          Issue Type: Task
>          Components: API
>    Affects Versions: API 2.4.2
>            Reporter: Felix Meschberger
>         Attachments: SLING-2993.patch
>
>
> The interfaces and classes in the Sling API bundle are not currently properly 
> documented as to who is intended to implement or extend these. In the 
> interest of stable extensibility, the types should be marked as follows:
>   * Exceptions: Nothing to mark. These are concrete classes intended for 
> extension
>   * Abstract Classes: Annotate with @ConsumerType. These are intended for 
> extension.
>   * Helper/Util/Constant Classes: Mark final because there is no use 
> extending them.
>   * Interfaces: For each interface decide whether they are implemented by a 
> single service (e.g. ResourceResovlerFactory) or by multiple service 
> providers (e.g. ResourceProvider).
> Technically the @ConsumerType annotation is not required because it is the 
> default. Yet, I think we should mark all non-@ProviderType types with 
> @ConsumerType to clarify the distinction.
> Will attach a proposed patch to this issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to