Eclipse 、 Equinox 和 OSGi
来源:互联网 发布:python 调用shell脚本 编辑:程序博客网 时间:2024/05/16 08:04
转自:http://www.builder.com.cn/2008/0118/710899.shtml
很多Java程序员对Eclipse(日食 ,IBM 起这个名字,Sun大概有意见)都爱不释手,在JBuilder流行、主流内存配置还在256M的日子里,当我第一次成功运行Eclipse后就把JBuilder彻底请出了我的电脑硬盘。不错,这就是Elipse的魅力。
作为程序员在感受Eclipse带来诸多好处之后,强烈的好奇心驱使我在问:Eclipse的魅力从何而来。正如我们谈论一个美女为什么那么美一样,造成美的因素是多方面的(上次的人物访谈说节目中说:周迅是美女,有个摄影家还用尺子量周迅鼻子到下巴的距离来证明)。在Eclipse令人称道的很多因素中,其开放性的插件架构无疑是最浓重的一笔。
为Eclipse开发一个插件并没有想象中的那么复杂,使用Eclipse 的 Rich ClientPlatform 开发自己的软件界面也很容易上手。为Elipse带来如此魔力的就是:Equinox (月食)(http://eclipse.org/equinox)。本文的题目还有一个 OSGi ,OSGi 和 Equinox 的关系是什么呢?说来话长,简单的理解,相当于 JBoss 和 Ejb specification 的关系,或者 Tomcat 和 ServletSpecification 的关系。
OSGi 中的一个核心概念是: bundles 。
对于Equinox来说,bundles就是一个自描述型的jar文件,描述如下:
-------------------
Bundle-SymbolicName: org.eclipse.equinox.registry
Bundle-Version: 3.2.100.v20060918
Bundle-Name: Eclipse Extension Registry
Bundle-Vendor: Eclipse.org
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.core.internal.registry.osgi.Activator
Export-Package: org.eclipse.equinox.registry
Import-Package: javax.xml.parsers,
org.xml.sax,
org.osgi.framework;version=1.3
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,J2SE-1.3
------------------
如果单纯作为一个插件机制,尽管Equinox解决方法很棒,但并没有什么过人之处,最让我感到惊奇的是他的“包容”能力。原文一句话说的好:“Thereare two main approaches; embedding Equinox in the servlet container orembedding the servlet container in
Equinox”。
看看下面这3个图吧:
Figure 1: Traditional web application server structure
Figure 2: Embedding Equinox in an existing application container
Figure 3: Embedding an application container in Equinox
从高内聚,低耦合到从设计模式,从 Ioc 、 Spring 框架 到 SOA我们一步一步的抽象着、分离着。很显然,我们需要一个灵活而不失严谨的架构,需要一个功能强进而不令人生畏的产品;幸好,软件科学是正是这样一种科学,他总可以加入更多的中间层来把问题解决的更好。
- Eclipse 、 Equinox 和 OSGi
- tss: Eclipse 、 Equinox 和 OSGi
- Equinox 和 OSGI 介绍
- Equinox OSGi
- 【OSGi】Could not find bundle: org.eclipse.equinox.console
- 【OSGi】Could not find bundle: org.eclipse.equinox.console问题
- 读《OSGI与Equinox创建高度模块化的Java系统》笔记(一)eclipse环境搭建和简单事例
- OSGI之Debug Equinox
- equinox的osgi命令
- OSGI Equinox 环境搭建
- osgi equinox helloword
- OSGi#1:Equinox 初探
- OSGI EQUINOX 参数配置
- 使用equinox开发osgi
- OSGi——运行工具箱的配置(org.eclipse.equinox.http org.eclipse.equinox.servlet.api)问题
- Equinox OSGi系列之一 Equinox入门
- Equinox OSGi系列之一 Equinox入门
- Equinox OSGi系列之一 Equinox入门
- PKG文件范例详解
- 转: ㊣㊣话说程序员的职业生涯㊣㊣
- 别野
- 堆栈异常:Exception Class Is Not Empty
- 我的身前即使没有你的影子,你也真实的在我心里
- Eclipse 、 Equinox 和 OSGi
- 实现本电脑的网络流量统计
- WinCE EBOOT的入口Startup.s(转载)
- Fedora8上交叉编译qtopia4移植成功到s3c2410开发板
- 工作难道要付出如此代价吗?
- 没有人地方
- 跳出低级开发的怪圈,走向更高的层次,不仅仅只关注代码,而更要上升为设计,复用等
- hi all
- 42