Skip to content

Commit fc7b8ae

Browse files
committed
Fix anchor name, consistently use title case, and polish wording
(cherry picked from commit 2e6c8da)
1 parent c457131 commit fc7b8ae

File tree

1 file changed

+8
-8
lines changed
  • framework-docs/modules/ROOT/pages/core

1 file changed

+8
-8
lines changed

Diff for: framework-docs/modules/ROOT/pages/core/aot.adoc

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ NOTE: At the moment, AOT is focused on allowing Spring applications to be deploy
3636
We intend to support more JVM-based use cases in future generations.
3737

3838
[[aot.basics]]
39-
== AOT engine overview
39+
== AOT Engine Overview
4040

4141
The entry point of the AOT engine for processing an `ApplicationContext` is `ApplicationContextAotGenerator`. It takes care of the following steps, based on a `GenericApplicationContext` that represents the application to optimize and a {spring-framework-api}/aot/generate/GenerationContext.html[`GenerationContext`]:
4242

@@ -225,7 +225,7 @@ When a `datasource` instance is required, a `BeanInstanceSupplier` is called.
225225
This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean.
226226

227227
[[aot.running]]
228-
== Running with AOT optimizations
228+
== Running with AOT Optimizations
229229

230230
AOT is a mandatory step to transform a Spring application to a native executable, so it
231231
is automatically enabled when running in this mode. It is possible to use those optimizations
@@ -244,7 +244,7 @@ However, keep in mind that some optimizations are made at build time based on a
244244
This section lists the best practices that make sure your application is ready for AOT.
245245

246246
[[aot.bestpractices.bean-registration]]
247-
=== Programmatic bean registration
247+
=== Programmatic Bean Registration
248248

249249
The AOT engine takes care of the `@Configuration` model and any callback that might be
250250
invoked as part of processing your configuration. If you need to register additional
@@ -266,7 +266,7 @@ notion of a classpath. For cases like this, it is crucial that the scanning happ
266266
build time.
267267

268268
[[aot.bestpractices.bean-type]]
269-
=== Expose The Most Precise Bean Type
269+
=== Expose the Most Precise Bean Type
270270

271271
While your application may interact with an interface that a bean implements, it is still very important to declare the most precise type.
272272
The AOT engine performs additional checks on the bean type, such as detecting the presence of `@Autowired` members or lifecycle callback methods.
@@ -326,21 +326,21 @@ However, this is not a best practice and flagging the preferred constructor with
326326

327327
In case you are working on a code base that you cannot modify, you can set the {spring-framework-api}/beans/factory/support/AbstractBeanDefinition.html#PREFERRED_CONSTRUCTORS_ATTRIBUTE[`preferredConstructors` attribute] on the related bean definition to indicate which constructor should be used.
328328

329-
[[aot.bestpractices.comlext-data-structure]]
330-
=== Avoid Complex Data Structure for Constructor Parameters and Properties
329+
[[aot.bestpractices.complex-data-structures]]
330+
=== Avoid Complex Data Structures for Constructor Parameters and Properties
331331

332332
When crafting a `RootBeanDefinition` programmatically, you are not constrained in terms of types that you can use.
333333
For instance, you may have a custom `record` with several properties that your bean takes as a constructor argument.
334334

335335
While this works fine with the regular runtime, AOT does not know how to generate the code of your custom data structure.
336336
A good rule of thumb is to keep in mind that bean definitions are an abstraction on top of several models.
337-
Rather than using such structure, decomposing to simple types or referring to a bean that is built as such is recommended.
337+
Rather than using such structures, decomposing to simple types or referring to a bean that is built as such is recommended.
338338

339339
As a last resort, you can implement your own `org.springframework.aot.generate.ValueCodeGenerator$Delegate`.
340340
To use it, register its fully qualified name in `META-INF/spring/aot.factories` using the `Delegate` as the key.
341341

342342
[[aot.bestpractices.custom-arguments]]
343-
=== Avoid Creating Bean with Custom Arguments
343+
=== Avoid Creating Beans with Custom Arguments
344344

345345
Spring AOT detects what needs to be done to create a bean and translates that in generated code using an instance supplier.
346346
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:

0 commit comments

Comments
 (0)