Skip to content

Commit 764738f

Browse files
committed
Add explanation/concept for extension maturity model
1 parent 891ffee commit 764738f

File tree

2 files changed

+96
-1
lines changed

2 files changed

+96
-1
lines changed

docs/src/main/asciidoc/extension-metadata.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include::_attributes.adoc[]
1111
Quarkus extensions are distributed as Maven JAR artifacts that application and other libraries may depend on. When a Quarkus application project is built, tested or edited using the Quarkus dev tools, Quarkus extension JAR artifacts will be identified on the application classpath by the presence of the Quarkus extension metadata files in them.
1212
This document describes the purpose of each Quarkus extension metadata file and its content.
1313

14-
IMPORTANT: Two of the metadata files have the same name but different extensions, `quarkus-extension.yaml` and `quarkus-extension.properties`. It is easy to mix them up, be careful. You will usually edit the YAML file and track it in your SCM. While you _can_ manually manage the properties file, Quarkus will generated it at build if you don't.
14+
IMPORTANT: Two of the metadata files have the same name but different extensions, `quarkus-extension.yaml` and `quarkus-extension.properties`. It is easy to mix them up, be careful. You will usually edit the YAML file and track it in your SCM. While you _can_ manually manage the properties file, Quarkus will generate it at build if you don't.
1515

1616
[[quarkus-extension-yaml]]
1717
== META-INF/quarkus-extension.yaml
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
[id="extension-maturity-model"]
3+
= Extension maturity model
4+
include::_attributes.adoc[]
5+
:diataxis-type: concept
6+
:categories: writing-extensions
7+
:topics: extensions
8+
:summary: Quarkus extensions can do a lot, or a little. This guide explains some of the capabilities extension authors may wish to include.
9+
////
10+
The document header ends at the first blank line. Do not remove the blank line between the header and the abstract summary.
11+
////
12+
13+
= A maturity model for Quarkus extensions
14+
15+
What makes a good Quarkus extension? What capabilities is a Quarkus extension expected to provide?
16+
17+
* It actually works
18+
** Works in JVM mode
19+
** Works in dev mode
20+
** Works in native
21+
* Dev service (if there is an external service dependency)
22+
* Developer joy
23+
** Configuration support
24+
** Use build-time application knowledge to remove boilerplate
25+
* Dev UI
26+
* Supersonic subatomic performance
27+
** Use build-time application knowledge to eliminate wasteful runtime code paths
28+
* Codestart application template
29+
30+
The order in this model isn't exact. Different developers will have different views on what capabilities are most important. You may wish to (say) prioritise performance over enhancing your extension's Dev UI tile. That's fine!
31+
Also, not every step will apply to every extension. For example, you don't need a dev service if your extension doesn't depend on external services.
32+
33+
Also note that this list only includes the technical features of your extension.
34+
You might also want to think about how you share your extension.
35+
The link:https://hub.quarkiverse.io/checklistfornewprojects/[new extension checklist] on the Quarkiverse Hub has a useful list of ways extensions can participate in the ecosystem.
36+
37+
Here are some pointers on how to achieve those capabilities.
38+
39+
== It actually works
40+
41+
=== Works in JVM mode
42+
43+
For most extensions, this is the minimum expectation.
44+
When wrapping an existing library, this is usually trivial to achieve; if an extension is providing net-new capability, it might be a bit more work. Quarkus provides tools for xref:writing-extensions#testing-extensions[unit testing and integration testing] extensions.
45+
46+
=== Works in dev mode
47+
48+
In some cases, extra work may be needed to ensure any wrapped libraries can tolerate
49+
dev mode, since the classloading is different and hot reloading can break some assumptions. Extensions may also wish to add some
50+
xref:writing-extensions#integrating-with-development-mode[special handling for dev mode].
51+
To add automated tests which validate dev mode, you can xref:writing-extensions#testing-hot-reload[add tests which extend the `QuarkusDevModeTest`].
52+
53+
=== Works as a native application
54+
55+
For many libraries, native mode support is the motivation for creating an extension. See xref:writing-extensions#native-executable-support[the guide on native executable support] for more discussion about some of the adaptations that might be needed.
56+
57+
== Developer joy
58+
59+
Developer joy is an important part of the Quarkus philosophy.
60+
Quarkus extensions should aim to xref:writing-extensions#expose-your-components-via-cdi[exponents components via CDI], so that they can be consimed in a frictionless way by user applications.
61+
62+
=== Configuration
63+
64+
Extensions should support Quarkus's unified configuration, by xref:writing-extensions#configuration[integrating with the Quarkus configuration model].
65+
The Writing Extensions guide has more guidance on xref:writing-extensions#how-to-expose-configuration[the Quarkus configuration philosophy].
66+
67+
=== Use build-time application knowledge to remove boilerplate
68+
69+
Many Quarkus extensions take advantage of being able to inspect the application at build-time to eliminate boilerplate and improve the developer experience.
70+
xref:writing-extensions#scanning-deployments-using-jandex[Jandex] allows user code to be scanned for annotations and other markers.
71+
72+
For some inspiration in this area, have a look at xref:logging#simplified-logging[simplified logging], xref:hibernate-orm-panache[simplified Hibernate ORM with Panache], the xref:rest-client#query-parameters[`@RestQuery` annotation], or the way Quarkus allows test containers to be used xref:getting-started-dev-services[without any configuration].
73+
74+
== Dev service
75+
76+
To provide a dev service, use the `DevServicesResultBuildItem` build item.
77+
78+
== Dev UI
79+
80+
Extensions can take advantage of the Dev UI to present extra information to users. See the xref:dev-ui[Dev UI for extension developers] guide.
81+
82+
== Supersonic subatomic performance
83+
84+
Because Quarkus moves work to the build stage, Quarkus applications should have fast startup, high throughput, and low memory requirements. Performance tuning is a large subject, but extensions should use build-time application knowledge to eliminate wasteful runtime code paths at runtime.
85+
86+
== Codestart application template
87+
88+
Codestarts are templates which can be used to generate applications for users.
89+
Extensions can xref:extension-codestart[provide their own codestart templates].
90+
91+
== References
92+
93+
- xref:writing-extensions[Writing your own extension] guide
94+
- xref:building-my-first-extension[Building your first extension]
95+
- link:https://hub.quarkiverse.io[The Quarkiverse Hub documentation]

0 commit comments

Comments
 (0)