java依赖注入上下文_Dynamic Context Dependency Injection:动态上下文依赖注入

Welcome to the Project Dynamic CDI

68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e73766768747470733a2f2f6275696c642e7261706964706d2e6f72672f6170702f726573742f6275696c64732f6275696c64547970653a69643a5261706964504d5f446576656c6f705f44796e616d6963446570656e64656e6379496e6a656374696f6e5f536e617073686f742f73746174757349636f6e

Here we will start with an more dynamic version of the default cdi implementations. This project is based on the project ProxyBuilder.

Please check out the HomePage for detailed informations. www.dynamic-dependency-injection.org/

This project could be used alone, but is developed for the project rapidpm-microservice. To get the full stack please check out the following projects.

for SNAPSHOTS

SNAPSHOTS

If you are using maven you could add the following to your settings.xml to get the snapshots.

allow-snapshots

true

snapshots-repo

https://oss.sonatype.org/content/repositories/snapshots

false

true

always

How DDI will resolve the corresponding Implementation?

if you write @Inject Interface

1 ClassResolver means: 1 ClassResolver responsible for the given Interface. You can have n ClassResolver inside your classpath. But for every Interface only one that is responsible for it.

Interface , no Impl. -> Exception

Interface , no Impl., 1 Producer for the Interface -> Producer for the Interface will be used

Interface , 1 Impl. -> will use the Impl.

Interface , 1 Impl., 1 Producer for Impl. -> Producer for the Impl will be used

Interface , 1 Impl., n Producer for Impl. -> Exception

Interface , 1 Impl., 1 Producer for Interface -> Producer for the Interface will be used

Interface , 1 Impl., n Producer for Interface -> Exception

Interface , 1 Impl., 1 Producer for Interface , 1 Producer for Impl. -> Exception

Interface , n Impl. -> Exception

Interface , n Impl., 1 responsible ClassResolver -> result of the ClassResolver will be used

Interface , n Impl., 1 Producer for Interface -> Producer for the Interface will be used

Interface , n Impl., 1-n Producer for Impl. -> Exception

Interface , n Impl., 1 responsible ClassResolver, 1 Producer for Interface -> Producer for the Interface will be used

Interface , n Impl., 1 responsible ClassResolver, 1-n Producer for Impl. -> will use the resolved Class or corresponding Producer if available

Interface , n Impl., n responsible ClassResolver -> Exception

Interface, 1 Impl., n Producer for Impl, 1 ProducerResolver for Impl -> selected Producer from ProducerResolver

Interface, n Impl., 1 responsible ClassResolver, 0-n Producer for every Impl, 1 ProducerResolver for every Impl -> selected Producer from ProducerResolver, for selected Impl from ClassResolver

if you write @Inject Impl.

Impl. -> will use the Impl.

Impl., 1 Producer -> will use the Producer for the Impl.

You can combine all with a @Proxy(virtual=true) and it will use the same solution, but only as VirtualProxy.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值