Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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

Copy link
Copy link
@pyricau

Description

@pyricau
Issue body actions

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 ?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.