Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Scopes for @Rest #207

@pyricau

Description

@pyricau

The @Rest generated implementation rely on a RestTemplate instance. Currently, each injection of an @Rest annotated interface leads to the creation of a new instance of the class implementing this interface.

Users can customize the RestTemplate instance, but they have to do it on a per implementation instance bases, which isn't great. This also leads to the creation of a lost of RestTemplate instance.

We could either :

  • Let @Rest implementations be singletons. But there might be cases where one need different configurations and thefore different instances
  • Allow scope configurations (singleton / prototype / context?). In such a case, we must decide what's the best "default". It's probably singleton, but since @EBean has a default on prototype, maybe we should emphasize coherence

By the way, this isn't totally related, but maybe we should create an interface with setRestTemplate() and getRestTemplate() methods, and let @Rest clients implement it, rather then defining the methods in the interface ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions