Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Apr 24, 2024
1 parent 09b476a commit 546ca9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions framework-docs/modules/ROOT/pages/core/aot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ In case you are working on a code base that you cannot modify, you can set the {
Spring AOT detects what needs to be done to create a bean and translates that in generated code using an instance supplier.
The container also supports creating a bean with {spring-framework-api}++/beans/factory/BeanFactory.html#getBean(java.lang.String,java.lang.Object...)++[custom arguments] that leads to several issues with AOT:

. The custom arguments require a dynamic introspection of a matching constructor or factory method.
Those arguments can't be detected by AOT so the necessary reflection hints will have to be provided manually.
. By-passing the instance supplier means that all the other optimizations after creation are skipped as well.
. The custom arguments require dynamic introspection of a matching constructor or factory method.
Those arguments cannot be detected by AOT, so the necessary reflection hints will have to be provided manually.
. By-passing the instance supplier means that all other optimizations after creation are skipped as well.
For instance, autowiring on fields and methods will be skipped as they are handled in the instance supplier.

Rather than having prototype-scoped beans created with custom arguments, we recommend a manual factory pattern where a bean is responsible of the creation of the instance.
Rather than having prototype-scoped beans created with custom arguments, we recommend a manual factory pattern where a bean is responsible for the creation of the instance.

[[aot.bestpractices.factory-bean]]
=== FactoryBean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This can be done with `method(HttpMethod)` or with the convenience methods `get(
Next, the request URI can be specified with the `uri` methods.
This step is optional and can be skipped if the `RestClient` is configured with a default URI.
The URL is typically specified as a `String`, with optional URI template variables.
The following example configures a GET request to `"https://example.com/orders/42`:
The following example configures a GET request to `https://example.com/orders/42`:

[tabs]
======
Expand Down

0 comments on commit 546ca9b

Please sign in to comment.