两者是什么?
- Specification and implementation?
- Competitors?
- Unrelated?
两者是什么?
它们无关。
Edit:
DI是a conecpt , 第一次由Martin Fowler , 。 OSGi是 Java的一个单元系统,它实施一个完整和动态的组成部分模式,具体由。
秘书长特别代表的规格由两个分开的部分组成:核心和简编。
核心部分是确定 Java模块系统。 因此,核心规格与DI概念没有关系。
The compendium part, on the other side, specifies a series of services that an OSGi container can provide. Among this services you ll find the "Declarative Services Specification" (OSGi Compendium Services, Chapter 112) that is the first attempt to bring the familiar concept of DI into OSGi. The idea is simple: since OSGi allows the developer to implement, define and register services, the Declarative Services Specification gives the developer the possibility to define a service dependent on a series of other underlying services. That s a particularly interesting (and hard) problem in OSGi, because services are by definition unreliable, and they can appear and disappear.
除声明服务规格外,至少还有两项其他民众解决办法,试图在秘书长特别代表内提供一个更强大的移民发展框架:
值得注意的是,即将出版的秘书长特别代表专著R4.2版本将包含一个新简编,名为“蓝印服务”,它将根据“春DM”框架为秘书长特别代表提供完整的DI解决办法(春季小组为这一新规格作出了重大贡献)。
它们在概念上具有关联性,因为它们都提供了“关切的分离”机制。
职业妇女顾问办公室在模块一级这样做——考虑有多种假想的Eclipse架构,每个结构负责具体关注/特性。
DI在目标一级是面向的,它提供了将多个物体连接起来,每个物体都对其特定功能负责的手段。
Technologically they are different. OSGI is a spec that has multiple implementations. DI used to be a design pattern with multiple implementations and APIs. There is some recent work however in JCP to try to standardize DI APIs (JSR 330)