# helidon-inject
<b>Helidon Injection</b> is an optional feature in Helidon. At its core it provides these main features:
1. A service registry. The service registry holds service providers and are (or otherwise can produce) services. Each service provider in the registry advertises its meta-information for what each service provides, and what it requires in the way of dependencies.
2. A lifecycle engine. Each service provider in the registry remains dormant until there is a "demand for activation". This "demand for activation" is also known as "lazy activation" that can come in different ways. One way is to simply "get" a service (or services) from the registry that matches the meta-information criteria you provide programmatically. If the service (or services) need other services as part of the activation then those services are chain activated, recursively. Helidon Injection provides graceful startup and shutdown at a micro service-level as well as at a macro application level for all services in the service registry.
3. Integrations and Extensibility. More will be mentioned on this later.
Over the foundation of these three main features of "services registry", "lifecycle", and "extensibility" there are a number of other tooling and layers that are delivered from various Injection submodules that provide the following additional features and benefits:
1. A minimalist, compile-time generated dependency injection framework that is free from reflection, and compliant to the JSR-330 injection specification. Compile-time source code generation has a number of advantages, including: (a) pre-runtime validation of the DI model, (b) visibility into your application by providing "less magic", which in turn fosters understandability and debug-ability of your application, (c) deterministic behavior (instead of depending on reflection and classpath ordering, etc.) and (c) performance, since binding the model at compile-time is more efficient than computing it at runtime. Helidon Injection (through its tooling) provides you with a mix of declarative and programmatic ways to build your application. It doesn't have to be just one or the other like other popular frameworks in use today require. Inspiration for Helidon Injection, however, did come from many libraries and frameworks that came before it (e.g., Jakarta Hk2, Google Guice, Spring, CDI, and even OSGi). Foundationally, Injection provides a way to develop declarative code using standard (i.e., javax/jakarta, not Helidon specific) annotation types.
2. Integrations. Blending services from different providers (e.g., Helidon services like WebServer, your application service, 3rd party service, etc.) becomes natural in the Injection framework, and enables you to build fully-integrated, feature-rich applications more easily.
3. Extensibility. At the micro level developers can provide their own templates for things like code generation, or even provide an entirely different implementation from this reference implementation Helidon provides. At a macro level (and post the initial release), Injection will be providing a foundation to extend your Guice, Spring, Hk2, CDI, <fill-in the blank> application naturally into one application runtime. The Helidon team fields a number of support questions that involve this area involving "battling DI frameworks" like CDI w/ Hk2. In time, Helidon Injection aims to smooth out this area through the integrations and extensibility features that it will be providing.
4. Interception. Annotations are provided, that in conjunction with Helidon Injection's code-generation annotation processors, allow services in the service registry to support interception and decoration patterns - without the use of reflection at runtime, which is conducive to native image.
The Helidon Team believes that the above features help developers achieve the following goals:
* More IoC options. With Helidon Injection... developers can choose to use an imperative coding style or a declarative IoC style previously only available with CDI using Helidon MP. At the initial release (Helidon 4.0), however, Injection will only be available with Helidon Nima support.
* Compile-time benefits. With Injection... developers can decide to use compile-time code generation into their build process, thereby statically and deterministically wiring their injection model while still enjoying the benefits of a declarative approach for writing their application. Added to this, all code-generated artifacts are in source form instead of bytecode thereby making your application more readable, understandable, consistent, and debuggable. Furthermore, DI model inconsistencies can be found during compile-time instead of at runtime.
* Improved performance. Pushing more into compile-time helps reduce what otherwise would need to occur (often times via reflection) to built/compile-time processing. Native code is generated that is further optimized by the compiler. Additionally, with lazy activation of services, only what is needed is activated. Anything not used may be in the classpath is available, but unless and until there is demand for those services they remain dormant. You control the lifecycle in your application code.
* Additional lifecycle options. Injection can handle micro, service-level activations for your services, as well as offer controlled shutdown if desired.
Many DI frameworks start simple and over time become bloated with "bells and whistle" type features - the majority of which most developers don't need and will never use; especially in today's world of microservices where the application scope is the JVM process itself.
***
The <b>Helidon Injection Framework</b> is a reset back to basics, and perfect for such use cases requiring minimalism but yet still be extensible. This is why Injection intentionally chose to implement the earlier JSR-330 specification at its foundation. <i>Application Scope</i> == <i>Singleton Scope</i> in a microservices world.
***
Request and Session scopes are simply not made available in Helidon Injection. We believe that scoping is a recipe for undo complexity, confusion, and bugs for the many developers today.
## Terminology
* DI - Dependency Injection.
* Inject - The assignment of a <i>service</i> instance to a field or method setter that has been annotated with <i>@Inject</i> - also referred to as an injection point. In Spring this would be referred to as 'Autowired'.
* Injection Plan - The act of determining how your application will resolve each <i>injection point</i>. In Injection this can optionally be performed at compile-time. But even when the injection plan is deferred to runtime it is resolved without using reflection, and is therefore conducive to native image restrictions and enhanced performance.
* Service (aka Bean) - In Spring this would be referred to as a <i>bean</i> with a <i>@Service</i> annotation; These are concrete class types in your application that represents some sort of business logic.
* Scope - This refers to the cardinality of a <i>service</i> instance in your application.
* Singleton - jakarta.inject.Singleton or javax.inject.Singleton - This is the default scope for services in Helidon Injection just like it is in Spring.
* Provided - jakarta.inject.Provider or javax.inject.Provider - If the <i>scope</i> of a <i>service</i> is not <i>Singleton</i> then it is considered to be a Provided scope - and the cardinality will be ascribed to the implementation of the Provider to determine its cardinality. The provider can optionally use the <i>injection point</i> context to determine the appropriate instance and/or cardinality it provides.
* Contract - These are how a service can alias itself for injection. Contracts are typically the interface or abstract base class definitions of a <i>service</i> implementation. <i>Injection points</i> must be based upon either using a contract or service that Injection is aware of, usually through annotation processi
没有合适的资源?快使用搜索试试~ 我知道了~
Java libraries for writing microservices.zip
共2000个文件
java:1490个
md:201个
xml:158个
需积分: 1 0 下载量 149 浏览量
2023-12-29
20:39:57
上传
评论
收藏 15.94MB ZIP 举报
温馨提示
Java libraries for writing microservices.zip
资源推荐
资源详情
资源评论
收起资源包目录
Java libraries for writing microservices.zip (2000个子文件)
helidon-javadoc.css 1KB
Jwt.java 71KB
Security.java 62KB
OidcConfig.java 56KB
GenerateAbstractBuilder.java 45KB
Http1ClientTest.java 43KB
Http2Connection.java 40KB
NamedStatementParser.java 39KB
MMeterRegistry.java 36KB
EncryptedJwt.java 35KB
SecurityHandler.java 34KB
JwtProvider.java 34KB
Http1ServerResponse.java 28KB
OidcFeature.java 28KB
Proxy.java 27KB
HttpRouting.java 27KB
RoleValidatorTest.java 25KB
JsonFormatter.java 24KB
Http1CallOutputStreamChain.java 24KB
JwtProviderTest.java 24KB
Http1ClientTest.java 24KB
AnnotationSupport.java 24KB
Http2ServerStream.java 24KB
ResponseHelper.java 24KB
TenantAuthenticationHandler.java 24KB
TypeHandler.java 24KB
HttpAuthProviderBuilderTest.java 23KB
TypeHandlerMap.java 23KB
IdcsMtRoleMapperProvider.java 23KB
GoogleTokenProvider.java 23KB
BlueprintProcessor.java 23KB
Http1CallChainBase.java 22KB
StatementParsers.java 22KB
HttpSignProvider.java 22KB
OidcProvider.java 22KB
TypeContext.java 22KB
Http1Connection.java 22KB
NoOpMeter.java 21KB
IdcsRoleMapperProviderBase.java 21KB
TracingObserver.java 20KB
Http2ClientConnection.java 20KB
Http2ClientStream.java 20KB
HttpDigestAuthProvider.java 20KB
DbClientHealthCheck.java 19KB
Prototype.java 19KB
AnnotationBlueprint.java 19KB
AnnotationDataOption.java 19KB
HttpBasicAuthProvider.java 19KB
TypeHandlerCollection.java 19KB
HttpRules.java 18KB
JwtHeaders.java 18KB
ValidationTask.java 17KB
BaseBuilder.java 17KB
JwtUtil.java 17KB
Http2CallOutputStreamChain.java 17KB
HttpSignature.java 17KB
ReflectionUtilTest.java 17KB
AbacProvider.java 17KB
FactoryMethods.java 17KB
ProvidedUtil.java 17KB
SignedJwt.java 16KB
ServerListener.java 16KB
EvictableCache.java 16KB
RoleValidator.java 16KB
AccessLogRoutingFeature.java 16KB
Jwk.java 16KB
Http2ClientConnectionHandler.java 15KB
Continue100Test.java 15KB
Continue100ImmediatelyTest.java 15KB
CustomMethods.java 15KB
SystemMetersProvider.java 15KB
HeadersClientTest.java 15KB
JdbcStatement.java 15KB
Option.java 15KB
ClassPathContentHandler.java 15KB
SecurityContext.java 15KB
CompositeProviderSelectionPolicy.java 15KB
SecurityEnvironment.java 15KB
ClientRequestBase.java 14KB
OutboundTarget.java 14KB
Http2CallChainBase.java 14KB
PolicyValidator.java 14KB
JwkEC.java 14KB
StaticContentHandler.java 14KB
StaticContentService.java 14KB
DbExecute.java 14KB
MetricsFactory.java 14KB
SecurityImpl.java 14KB
CurrentHttpSignatureTest.java 14KB
OldHttpSignatureTest.java 13KB
Subject.java 13KB
Http2WebClientTest.java 13KB
CachedHandlerTest.java 13KB
HttpProxy.java 13KB
JwkKeysTest.java 13KB
MicrometerPrometheusFormatter.java 13KB
MetricsFeature.java 13KB
StaticContentHandlerTest.java 13KB
MicrometerMetricsFactory.java 13KB
HelidonServerJunitExtension.java 13KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
zero2100
- 粉丝: 159
- 资源: 2464
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240509_034911_com.tencent.mtt.jpg
- 基于python实现的医学影像体脂分割+源代码+文档说明(课程设计)
- 基于python实现的医学影像(MIR, CT )图像分割源码+文档说明(高分课程设计)
- 基于python+JavaScript实现的医学影像分割+源代码+文档说明+截图演示+数据(高分毕业设计)
- 基于U-net+pytorch实现的医学影像分割python源码+文档说明+数据+界面截图+博客介绍
- 课程设计-基于Pytorch实现MNIST数据集的手写数字识别源码+数据(Gui界面)+文档说明+模型
- 软件开发国家标准.xls
- pytorch-CNN-SBATM-ubuntudemo
- matplotlibdemo
- pytorch-CNN-dht11温湿度传感器笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功