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

Amelchev Nikita updated IGNITE-15801:
-------------------------------------
    Fix Version/s: 2.13

> Annotation-based injection of ServiceContext in Ignite services.
> ----------------------------------------------------------------
>
>                 Key: IGNITE-15801
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15801
>             Project: Ignite
>          Issue Type: Improvement
>          Components: managed services
>            Reporter: Pavel Pereslegin
>            Assignee: Pavel Pereslegin
>            Priority: Major
>             Fix For: 2.13
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Inject ServiceContext using special annotation.
> Suggested approach for Java services:
> _1. Add init/execute/cancel methods without parameters._
>  _2. Add default no-op implementations for the new methods (this is required_ 
> _to preserve compatibility)._
>  _3. For old methods that take ServiceContext as a parameter, add default_ 
> _implementations that delegate to new methods._
>  _4. Deprecate the old methods on the API._
>  _5. On the implementation level, still use the old methods (again - for_ 
> _compatibility)._
>  _6. Finally, add a @ServiceContextResource annotation to inject_ 
> _ServiceContext._
> Pros:
>  1. The annotation-based injection is a user-friendly approach widely used in 
> Ignite.
>  2. The user does not need to implement all the lifecycle methods every time.
> Cons:
>  1. Duplication of methods in the Service interface for an indefinite period.
>  2. Someday we need to remove the old methods, and this will break all ignite 
> services that use the old approach.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to