﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-BlueDavy之技术Blog-随笔分类-Plugin Architecture</title><link>http://www.blogjava.net/BlueDavy/category/1514.html</link><description>不懂理论只懂实战的粗人。&lt;br&gt;
&amp;nbsp;&amp;nbsp;
&lt;a href="http://www.fastonlineusers.com"&gt;&lt;b&gt;&lt;font color=red&gt;共有&lt;script src=http://fastonlineusers.com/online.php?d=bluedavy.blogjava.net&gt;&lt;/script&gt;人在同时阅读此Blog&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 08:40:18 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 08:40:18 GMT</pubDate><ttl>60</ttl><item><title>基于Eclipse Equinox的插件框架：TPF</title><link>http://www.blogjava.net/BlueDavy/archive/2006/08/18/64440.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Fri, 18 Aug 2006 13:24:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2006/08/18/64440.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/64440.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2006/08/18/64440.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/64440.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/64440.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 这篇blog是继之前的一篇提升C/S结构软件的管理性的延续，在这篇blog中会更加的实际的去介绍基于Eclipse Equinox实现的一个插件框架，而不再是象上篇中那样的提及的想法而已了，通过这篇blog来展现目前一个这样的插件框架的实际应用的情况，为了更加形象的表达，在文中会贴出一些目前这个系统的截图。&nbsp;&nbsp;<a href='http://www.blogjava.net/BlueDavy/archive/2006/08/18/64440.html'>阅读全文</a><img src ="http://www.blogjava.net/BlueDavy/aggbug/64440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2006-08-18 21:24 <a href="http://www.blogjava.net/BlueDavy/archive/2006/08/18/64440.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>插件开发框架的思考</title><link>http://www.blogjava.net/BlueDavy/archive/2006/05/28/48593.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Sun, 28 May 2006 07:05:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2006/05/28/48593.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/48593.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2006/05/28/48593.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/48593.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/48593.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 插件开发框架其实和目前开源界流行的MVC框架之类的相同，都决定了基于这个框架的开发方式，如基于MVC框架，就会按照MVC思想来进行开发，而插件开发框架呢，也是同样如此，就要求基于插件的方式来进行开发，不过插件开发框架和MVC框架又有不同，插件开发框架是一个可以成为系统基础架构的框架，而MVC框架通常来讲不足以成为，如在目前的MVC框架Webwork、Struts上我们通常都需要加上Spring、Hibernate来构成系统完整的基础架构，这个时候由于MVC框架的实现是没有标准可参照的，就造成了在各种系统中形成了不同的但很类似的基础架构，但却造成了无法复用的现象；插件开发框架则是作为统一系统基础架构的一种开发方式，它使得系统的复用成为了可能，而同时由于插件开发框架对于动态性的支持，使得系统更加的灵活和可扩展。<br>来看看一个插件开发框架，应该提供些什么东西，作为改变系统架构思想的框架，插件框架需要考虑很多方面，如开发、测试、部署等，总结下来一个插件框架应提供插件的开发规范；插件开发、调试的IDE；插件的测试方法；插件的部署策略以及插件的管理端。&nbsp;&nbsp;<a href='http://www.blogjava.net/BlueDavy/archive/2006/05/28/48593.html'>阅读全文</a><img src ="http://www.blogjava.net/BlueDavy/aggbug/48593.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2006-05-28 15:05 <a href="http://www.blogjava.net/BlueDavy/archive/2006/05/28/48593.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Service-Oriented Component Model(SOCM)</title><link>http://www.blogjava.net/BlueDavy/archive/2006/04/15/41268.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Sat, 15 Apr 2006 13:33:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2006/04/15/41268.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/41268.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2006/04/15/41268.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/41268.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/41268.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 继续以OSGI R4的Declarative Services(DS)来讲讲Service-Oriented Component Model(SOCM)，SOCM对于现有的Component-Oriented Model或者是Service-Oriented Model来说到底有什么不同的地方，到底DS能给我们带来什么样的好处呢？&nbsp;&nbsp;<a href='http://www.blogjava.net/BlueDavy/archive/2006/04/15/41268.html'>阅读全文</a><img src ="http://www.blogjava.net/BlueDavy/aggbug/41268.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2006-04-15 21:33 <a href="http://www.blogjava.net/BlueDavy/archive/2006/04/15/41268.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Declarative Services――Service-Oriented Component Model</title><link>http://www.blogjava.net/BlueDavy/archive/2006/04/07/39880.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Fri, 07 Apr 2006 09:27:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2006/04/07/39880.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/39880.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2006/04/07/39880.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/39880.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/39880.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Jeff在EclipseCon 2006那篇介绍Equinox的PPT中提到的Declarative Services(文中全部采用DS简称)的用法让人极度被吸引，但同时又产生怀疑，想起以前自己看过DS好像不是这样的，没这么强，便再次翻阅了OSGI R4中的DS的章节，以验证Jeff的说法，^_^，仔细看过DS章节后，确实为Declarative Services的强大而感到高兴，DS是一个面向服务的组件模型，从组件模型层次上去看，它超越了传统的组件模型，在组件模型描述的完备性上有了很大的进步，例如在组件服务的依赖上、组件服务的延迟加载上、组件服务的多样性控制上、组件服务的配置上以及组件服务的生命周期管理上，不过DS只能在OSGI容器中使用，这尽管看上去可能是个弱点，但作为OSGI规范中的一部分，这无可厚非，其思想值得很多目前Component Model的开源框架值得思考和学习，如感兴趣，请阅读OSGI R4中DS章节。&nbsp;&nbsp;<a href='http://www.blogjava.net/BlueDavy/archive/2006/04/07/39880.html'>阅读全文</a><img src ="http://www.blogjava.net/BlueDavy/aggbug/39880.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2006-04-07 17:27 <a href="http://www.blogjava.net/BlueDavy/archive/2006/04/07/39880.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>基于Equinox开发系统的总结</title><link>http://www.blogjava.net/BlueDavy/archive/2006/03/12/34930.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Sun, 12 Mar 2006 13:32:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2006/03/12/34930.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/34930.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2006/03/12/34930.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/34930.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/34930.html</trackback:ping><description><![CDATA[<P>Equinox，我不想多做介绍，相信很多人都有所了解了，不了解的可具体去<A href="http://www.eclipse.org/equinox">www.eclipse.org/equinox</A>看看。<BR>最近基于equinox做了一个系统，还是碰到了一些问题，当然也得到了在插件体系架构下的不少优点，在这里也做个总结。<BR>总体而言，基于equinox做开发对于大多数java开发人员来说应该不会有太多改变的感觉，最多改变的感觉应该是带给设计师，设计师需要有发挥插件体系架构优点以及减少其带来的缺点的能力，^_^<BR>1、部署不是很方便<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; equinox默认提供的是一个console端的插件部署管理，部署起来需要通过"install reference:file://"这样的方式来安装插件，不是特别的方便。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^_^，由于我当时使用的时候equinox还没提供osgi中httpservice的实现，便使用了oscar中提供的httpservice的实现，基于这个httpservice的实现写了一个web端的插件管理的工具，呵呵，将来整理后会将这个bundle公布出来，到时大家直接下载就可以用了。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在部署方面还有一个不方便的地方就是不能指定插件的启动顺序，现在equinox是通过config.ini中来实现插件启动顺序的控制的，这个在我的web端的插件管理工具中也提供直接，可直接设定插件的启动顺序。<BR>2、Classpath的问题<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这个问题是我在使用equinox时比较头疼的一个问题，我在bundle中使用了spring IoC container，而由于spring中使用的不是当前类的加载器，导致在加载配置文件的时候会出错，只得直接修改了spring中那些部分的代码，将其改为使用当前类的加载器。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在集成其他一些自己含有classpath的东西的时候也很容易出现这个问题。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 虽然从原理上来讲这个是可以理解的，因为在插件体系结构中每个插件都拥有独立的插件类加载器，这个确实会对集成的有些东西产生影响，抑或我们应该理解为集成的那些东西在这方面设计有缺陷？<BR>3、有利于面向接口编程的执行<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这个应该说是属于插件体系结构的好处，每个插件可以控制自己对外所暴露的包，这个时候就可以只暴露接口所在的包，^_^，呵呵，面向接口的编程就这么被强制的执行了。<BR>4、插件开发的IDE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这点是我觉得equinox的天然优势，拥有一个eclipse这么优秀的插件开发的IDE，^_^<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 支持了插件的调试...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我认为的最重要的一点是它解决了插件依赖的问题，通常在出现project依赖的时候我们都需要引用该project或是该project生成的jar，而在插件体系结构中只需要在插件文件中定义所依赖的包即可，这个就解决了去引用project那样方式引起整个项目工程包混乱和开发不便的现象。 <BR>5、插件的测试<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这点我想也是大家很关心的，不过大家可以放心，基本没什么不同的，unit test继续使用Mock方式完成所测试的unit的外部依赖的部分，集成测试则需要启动equinox容器，这点应该没什么不能接受的。<BR>6、Bundle和Service的定义<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这个就是插件体系结构带来的一个挑战，如果准确的定义系统中的bundle和service是很关键的一个问题，这对于发挥插件体系结构的bundle级别、service级别的重用性至关重要，同时对于整个项目结构的清晰度也会产生很大的影响，形成bundle的清晰的service依赖结构。<BR>7、面向服务的体系<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我想这也同样是象equinox这样的插件框架引发使用者的思考，系统采用的应该是一种面向服务的体系，服务才是系统的核心，bundle只是一个管理器而已，这个时候怎么样设计出动态、松散耦合的服务体系是很关键的。<BR><BR>equinox一直都在发展之中，它的maillist一直就非常的热闹，而且现在对于osgi中的service它基本都实现了，也已经开始提供对于servlet container集成的支持，^_^，极度支持equinox，虽然它还需要不断的努力.....<BR>可以看得出，经过我上面的总结，大家其实要担心的是引用一种新的体系结构带来的设计层面的变革，而不是开发实现层面，^_^&nbsp;</P><img src ="http://www.blogjava.net/BlueDavy/aggbug/34930.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2006-03-12 21:32 <a href="http://www.blogjava.net/BlueDavy/archive/2006/03/12/34930.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>思考插件架构体系</title><link>http://www.blogjava.net/BlueDavy/archive/2005/11/15/19820.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Tue, 15 Nov 2005 03:09:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/11/15/19820.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/19820.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/11/15/19820.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/19820.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/19820.html</trackback:ping><description><![CDATA[<P>插件架构体系是我一直就非常关注的内容，其实插件架构体系的发展已经有很久的背景了，插件架构体系的优点我们也是能看的非常明显，象硬件一样的即插即用、无论对于公司还是业界而言的良好的积累方式、为公司或业界提供统一而规范的开发方式以及稳定的内核架构等等，这些优点无论对于公司还是业界来说都是非常重要的。<BR>插件架构体系基本的一个概念就是基于松散的模块积累方式，通过新增插件以及扩展原有插件的方法来完成系统的实现，凡事有利必有弊，在看到插件架构体系的这些优点的同时，在实现和使用插件架构体系的时候仍然会碰到不少的问题，我大概的整理了一下，主要有：<BR>1、插件的定义<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 插件的定义可谓是插件架构体系在使用时会碰到的最大的问题，首先要解决的问题就是何谓插件、插件如何去定义？何谓插件这个大家的看法都会有所不同，由于对于何谓插件的看法不同，必然就导致了在整个系统的设计时采用了不同的设计方式，主要是在插件的粒度控制上会有不同的设计方式。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 个人觉得也许采用模块作为插件是一种可行的方案，采用模块作为插件的核心思想是按一种从顶至下的设计理念，也就是架构设计中产生的模块视图首先作为系统的插件构成视图，根据对模块的详细设计此时又可对模块的插件进行细一步的划分，或者是将插件划的更细，或者是采用插件的扩展机制去实现。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 插件的定义则是带来了一些设计上的难度的，我仍然觉得需要将插件视为黑盒去看，插件需要提供什么样的功能、插件需要什么样的运行环境、插件需要暴露哪些包等等，这个在Osgi中都有相应的映射，在基于插件架构体系进行系统构建的时候插件的粒度、定义我觉得这是最难把握的，甚至觉得难度上会超过以前的模块设计，需要的是更为规范的模块式的设计，觉得这个在中小型软件企业中往往是很难做到的，主要仍然是架构设计时的控制，在设计时重要的因素在于保持系统的松散结构，至于概要设计时则完全可按照架构设计的约束去进行，详细设计则完全和平时的做法一样。<BR>2、插件的依赖<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 插件的依赖主要有两种，一是对于系统已有插件的依赖，另一方面则是对于外部jar包的依赖。这都是在设计时需要做出考虑的，对于插件架构体系而言对已有插件的依赖和对外部jar包的依赖这个差别就比较大了，其实这个在设计上还好办，因为可以通过重构，本来一直依赖觉得最困难的是对其他插件的依赖怎么办，难道要去引用其他plugin的lib，在eclipse ide中是解决了这个问题的，所以现在来说插件的依赖在插件体系架构中就显得没那么困难了，这说明插件的依赖的解决依赖于一个良好的插件开发IDE。<BR>3、插件的测试<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 插件的测试我这指的不是运行的功能测试，而是单元测试，感觉这个在现在的插件架构体系里还是比较困难的，因为在一种松耦合的架构体系中，对于其他插件的依赖是要在容器运行期才能够获取的，觉得这个有点变成了当时ejb container的问题，现在好像得通过mock以及其他的方法去解决，另外一个也许是IoC的策略？这方面需要进一步思考，<BR>4、插件的调试<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 插件的调试主要是依赖容器的调试，现在的eclipse ide已经支持插件的调试，并且好像是支持插件的远程调试的。<BR>5、插件开发学习的门槛<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 就目前来说插件开发学习的门槛并不算低的，个人觉得至少要对插件体系架构有一定的了解(例如基于Osgi的插件框架，那就要求对OSGI有一定的熟悉)，但相对这个门槛而言，其获得的价值是值得的。<BR><BR>其实讲了这么些问题，集中的主要在于基于插件架构体系的应用框架以及业务系统的设计方式将和以前的会有些变化，这个也是可以理解的，毕竟是受技术架构约束的，另外一方面则主要集中在插件开发的简易性和质量的保证，这个就得依靠一个强大的插件开发IDE。</P><img src ="http://www.blogjava.net/BlueDavy/aggbug/19820.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-11-15 11:09 <a href="http://www.blogjava.net/BlueDavy/archive/2005/11/15/19820.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OSGI与Plugin Architecture</title><link>http://www.blogjava.net/BlueDavy/archive/2005/11/06/18491.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Sun, 06 Nov 2005 12:19:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/11/06/18491.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/18491.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/11/06/18491.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/18491.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/18491.html</trackback:ping><description><![CDATA[大家都知道Eclipse是一个典型的插件系统，而从3.0起其插件体系架构就重构为基于OSGI规范来实现的，从这也可以看出osgi必然与Plugin Architecture是有很多的关联性的，在这里就来说说自己对Osgi R3与Plugin Architecture的关联。<BR>首先还是来说说作为一个Plugin Architecture应该提供哪些功能：<BR>1、插件的定义。<BR>2、插件的加载。(文件、URL等形式)<BR>3、插件的生命周期管理。(安装、卸载、启动、停止、更新)<BR>4、插件间的交互机制。<BR>5、插件的扩展。<BR>从非功能性角度来讲，作为Plugin Architecture应该对原有的非Plugin Architecture的系统的改造不能造成过大的侵入性，还有就是Plugin的管理以及易开发，其次作为Plugin Architecture，其最大的优点莫过于可以保证系统构成了一个平稳的结构体系，所有的交互、扩展都通过Plugin来进行，并同时保证各个Plugin的独立性，使得系统基于一种拼装式的结构(松耦合)，每个Plugin对于外部而言都是一个黑盒，那么就要相应的告诉外部这个黑盒所能提供的功能，调用的方式等。<BR>现在来说说OSGI，Osgi规范于1999年开始制定，目前版本是R4，OSGI之前主要用于网络设备的服务架构体系，那是一个典型的松耦合的服务架构体系，在被eclipse引入作为其插件体系架构后OSGI也被业界所关注，R4更是吸取了Eclipse的很多优点修订而成，相对于上面的功能点来说说OSGI对应的规范点：<BR>1、插件的定义。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSGI规范中将插件称为Bundle，Bundle作为整个插件的生命周期管理对象，负责插件的启动和停止动作，通过Meta-inf/mainfest.mf来描述Bundle，主要描述Bundle的名称、厂商、版本、对外暴露的包、对外暴露的服务、依赖的插件、引用的包、动态引用的包等，具体可参考OSGI R4中Framework&nbsp;Specification Chapter，插件可通过Bundle对象获取插件的定义信息。<BR>2、插件的加载。(文件、URL等形式)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OSGI规范中定义通过BundleContext来完成Bundle的加载工作，每个Bundle拥有独立的classloader以及BundleContext。<BR>3、插件的生命周期管理。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSGI规范中定义通过BundleContext对Bundle进行生命周期的管理，或通过Bundle本身对象来进行。<BR>4、插件间的交互机制。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSGI规范中定义通过插件的定义中定义所需依赖的插件以及所需引用的包来实现插件的交互机制。<BR>5、插件的开发。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSGI规范中定义一个新的插件的开发需要的是构成其BundleActivator对象以及完成插件定义的描述。<BR>6、插件所暴露的功能。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSGI规范中定义通过在插件定义文件中描述插件所暴露对外的服务来说明插件对外所暴露的功能以及允许外部对此插件引用的包。<BR><BR>对于插件如何扩展OSGI规范中提及的是在修改插件后插件的自动更新以及热加载来实现，而不是象Eclipse的扩展点机制。<BR><BR>根据上面我们可以看出OSGI规范确实非常适用于Plugin Architecture，对应点基本都存在，不过上面只是简单的描述，具体的大家可参看OSGI R4，除了对于Framework的定义，OSGI R4中还定义了一些常用的服务的规范(如log、configuration、security等)，而且有Eclipse作为其R4的RI，Eclipse则使得插件的管理、&nbsp;扩展以及易开发得到了保证，在管理上Eclipse上提供了管理的平台，在扩展上eclipse上提供了扩展点机制，在易开发上eclipse提供了ide，使得插件的代码开发、定义描述、调试甚至部署都变得非常的简单，而且eclipse会根据插件定义文件中需引用的包以及依赖的插件而自动的构造相应的classloader而无需去引用那些lib，这保证了插件的独立性(设计时)，呵呵，但大家是不是有发现什么不足点呢？<BR>个人觉得OSGI规范中的不足点是插件的管理机制的定义，插件的管理机制上我觉得可以参考JMX增加一个Connector or Protocol layer plugin，^_^<BR>插件的扩展机制由eclipse弥补了，其他的还真想不出什么不足点了。<BR><BR>突然开始觉得osgi比jmx+ioc实现的plugin architecture更为的好，以前觉得osgi没有jmx+ioc好的原因在于osgi对于插件的独立性保持的不够，意思就是在插件对于外部或其他插件作为黑盒而言，没有明确插件功能的描述以及调用方式的描述，这个怪自己之前对osgi规范看的不够仔细，其实就是service，而在独立性方面以前是想着在代码中如果要直接调用其他插件的service，那岂不是要引用那个插件的包，而这个问题在eclipse ide中是解决了的，只需要在定义文件中定义所依赖的插件即可，而不需要引用那个包，那么这样独立性的问题自然也解决了，还有一个是管理性，在这方面仍然是jmx更为强，不过完全可以在osgi中增加一个admin plugin的实现，吸取jmx在这方面的优点，呵呵，而相比之下现在变成了jmx+ioc并没有一个规范式的体系架构，实现起来只能是各按各的想法，而osgi的话毕竟是个规范，加上已经有eclipse这个现成的，何必再去发明轮子呢，^_^，也许某一天plugin architecture也会被列入jsr规范之中的。<img src ="http://www.blogjava.net/BlueDavy/aggbug/18491.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-11-06 20:19 <a href="http://www.blogjava.net/BlueDavy/archive/2005/11/06/18491.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse(3.1) Plugin Framework(基于OSGI的Plugin Architecture)</title><link>http://www.blogjava.net/BlueDavy/archive/2005/07/03/7069.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Sun, 03 Jul 2005 13:57:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/07/03/7069.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/7069.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/07/03/7069.html#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/7069.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/7069.html</trackback:ping><description><![CDATA[<P><FONT style="BACKGROUND-COLOR: #ffa500"><FONT color=#800080 size=5><STRONG>概述</STRONG></FONT><BR></FONT>Eclipse中最出彩的部分莫过于它的Plugin Framework，可以说Eclipse在一定程度上使得Plugin机制得以流行，当然，Eclipse的优势不仅仅在此，但正因为采用了Plugin机制，Eclipse才得以被不断的扩充，越来越强大。一直以来就想分析Eclipse的Plugin Framework，由于各种原因一直耽搁，刚好这个周末没什么事，下定决心对其进行了研究和分析，方法很原始，就是对Eclipse的启动过程进行分析，基于的是Eclipse 3.1的版本，分析过程就不在这说了，主要是说说分析出来的心得。<BR>架构上来讲Eclipse基本采用的是Kernel+Core Plugins+Custom Plugins的结构体系，除了Kernel部分外均为Plugin，所以可称为all are plugins，凡是Plugin的部分都是可被替换的。</P>
<P><FONT style="BACKGROUND-COLOR: #ffa500" color=#800080 size=5><STRONG>OSGI</STRONG></FONT><BR>Eclipse 3.0后采用的是OSGI来作为其Plugin Architecture实现的依据，鉴于此就得简单提提OSGI了，主要从Plugin的角度来分析OSGI，OSGI概念中主要分为了Bundle和Service，可以认为Bundle是一个模块的管理器，主要是通过BundleActivator管理模块的生命周期，而Service则是这个模块可暴露对外的服务对象，这里体现了OSGI和传统的Plugin Framework不同的一个地方，管理和静态结构分开，在OSGI中通过在manifest.mf文件中增加一些内容来发布Bundle，在其中描述了Bundle的提供商、版本、唯一ID、classpath、暴露对外的包、所依赖的包；每个Bundle拥有自己的ClassLoader以及context，通过context可进行服务的注册、卸载等，这些操作都会通过事件机制广播给相应的其他的Bundle；一般来说都为通过在Bundle中编写初始需要注册的服务的方法来完成Bundle可供外部使用的服务的暴露功能；如需要调用其他Plugin提供的服务可通过context的getServiceReference先获取Service的句柄，再通过context.getService(ServiceReference)的方法获取Service的实体。</P>
<P><FONT style="BACKGROUND-COLOR: #ffa500" color=#800080 size=5><STRONG>Eclipse Plugin定义<BR></STRONG></FONT>Eclipse中的Plugin的概念为包含一系列服务的模块即为一个Plugin。既然是遵循OSGI的，也就意味着Plugin通常是由Bundle和N多Service共同构成的，在此基础上Eclipse认为Plugin之间通常存在两种关系，一种为依赖，一种为扩展，对于依赖可通过OSGI中元描述信息里添加需要引用的Plugin即可实现，但扩展在OSGI中是没有定义的，Eclipse采用了一个Extension Point的方式来实现Plugin的扩展功能。<BR>结合OSGI<BR>Eclipse遵循OSGI对于Plugin的ID、版本、提供商、classpath、所依赖的plugin以及可暴露对外的包均在manifest.mf文件中定义。<BR>Plugin Extension Point<BR>对于扩展，Eclipse采用Extension Point的方式来实现，每个Plugin可定义自己的Extension Point，同时也可实现其他Plugin的Extension Point，由于这个在OSGI中是未定义的，在Eclipse中仍然通过在plugin.xml中进行描述，描述的方法为通过&lt;extension-point id="" name="" schema=""&gt;的形式来定义Plugin的扩展点，通过&lt;extension point=""&gt;的形式来定义实现的其他Plugin的扩展点，所提供的扩展点通过schema的方式进行描述，详细见eclipse extension-point schema规范，为了更好的说明扩展点这个概念，举例如下，如工具栏就是工具栏Plugin提供的一个扩展点，其他的Plugin可通过此扩展点添加按钮至工具栏中，并可相应的添加按钮所对应的事件(当然，此事件必须实现工具栏Plugin此扩展点所要求的接口)，工具栏的Plugin将通过callback的方式来相应的响应按钮的动作。可见通过Extension Point的方式可以很好的提供Plugin的扩展方式以及实现扩展的方式。</P>
<P><FONT style="BACKGROUND-COLOR: #ffa500" color=#800080 size=5><STRONG>Eclipse Plugin Framework</STRONG><BR></FONT>那么Eclipse是如何做到Plugin机制的实现的呢？？还是先讲讲Eclipse的设计风格，Eclipse在设计时有个重要的分层法则，即语言层相关和语言层无关的代码分开(如jdt.core和core)，核心与UI分开(如workbench.ui和workbench.core)这两个分层法则，这个在Eclipse代码中处处可见，在Plugin Framework部分也充分得体现了这个，遵循OSGI，Eclipse首先是实现了一个OSGI Impl，这个主要通过它的FrameWork、BundleHost、ServiceRegistry、BundleContextImpl等对象来实现，如果关心的话大家可以看看这部分的代码，实现了Bundle的安装、触发、卸载以及Service的注册、卸载、调用，在Plugin机制上Eclipse采用的为lazy load的方式，即在调用时才进行实际的启动，采用的为句柄/实体的方式来实现，外部则通过OSGI进行启动、停止等动作，各Plugin则通过BundleContext来进行服务的注册、卸载和调用，这是OSGI的部分实现的简单介绍。<BR>那么Extension Point方面Eclipse是如何实现的呢，在加载Plugin时，Eclipse通过对plugin.xml的解析获取其中的&lt;extension-point&gt;节点和&lt;extension&gt;节点，并相应的注册到ExtensionRegistry中，而各个提供扩展点的Plugin在提供扩展点的地方进行处理，如工具栏Plugin提供了工具栏的扩展点，那么在构成工具栏时Plugin将通过Platform.getPluginRegistry().getExtensionPoint(扩展点ID)的方法获取所有实现此扩展点的集合IExtensionPoint[]，通过此集合可获取IConfigurationElement[]，而通过这个就可以获取&lt;extension point=""&gt;其中的配置，同时还可通过IConfigurationElement创建回调对象的实例，通过这样的方法Eclipse也就实现了对于Plugin的扩展以及扩展的功能的回调。在Plugin Framework中还涉及很多事件机制的使用，比如Framework的事件机制，以便在Bundle注册、Service注册的时候进行通知。</P>
<P><FONT style="BACKGROUND-COLOR: #ffa500" color=#800080 size=5><STRONG>总结</STRONG></FONT><BR>通过对Eclipse启动过程的分析，可清晰的看到Eclipse Kernel+Core Plugins+Application Plugins的方式，在代码中分别对应为loadBasicBundles和registerApplicationServices，loadBasicBundles通过加载config.ini中的osgi.bundles完成基本的bundles的加载，去看看这个配置会发现是org.eclipse.core.runtime还有一个update，core.runtime又会通过IDEApplication来完成整个Eclipse的启动，同时会注册所有与workbench相关的plugin。<BR>Eclipse由于以前版本的Plugin Framework是没有采用OSGI的，所以通过EclipseAdaptor的方式来实现与以往的兼容，目前新的Plugin采用的方式基本就是manifest.mf描述Plugin OSGI部分的信息，Plugin.xml描述扩展点的信息。<BR>Eclipse中有非常多优秀的设计，这个在看它的代码时会有很深的感触，比如Contributing to Eclipse中提到的Extension Object/Interface的设计，确实是非常的不错，虽然看到你可能觉得很简单，关键是要想得到并合适的去使用。<BR>总结陈词，^_^，Eclipse Plugin Framework是采用OSGI Impl+Plugin Extension-Point的方式来共同实现的，实现了Plugin的部署、编写、独立的Classloader和Context、Plugin中Service的注册、Plugin中Service的调用、Plugin的依赖、Plugin的扩展、Plugin生命周期的管理。</P>
<P><FONT style="BACKGROUND-COLOR: #ffa500" color=#800080 size=5><STRONG>带来的思考<BR></STRONG></FONT>Eclipse Plugin Framework采用的是OSGI的实现，一定程度上我们也能看到OSGI的优点，那么JMX+IoC方式的Plugin Framework与其的比较又是在哪些方面呢？Eclipse Plugin Framework不足的地方又在哪里呢？哪些地方值得改进呢？</P>
<P>&nbsp;</P><img src ="http://www.blogjava.net/BlueDavy/aggbug/7069.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-07-03 21:57 <a href="http://www.blogjava.net/BlueDavy/archive/2005/07/03/7069.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Plugin Architecture简述</title><link>http://www.blogjava.net/BlueDavy/archive/2005/06/30/6925.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Thu, 30 Jun 2005 03:02:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/06/30/6925.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/6925.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/06/30/6925.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/6925.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/6925.html</trackback:ping><description><![CDATA[<P><FONT style="BACKGROUND-COLOR: #008000" color=#ffffff size=5><STRONG>概述</STRONG></FONT><BR>Plugin Architecture，无疑是如今软件界最为热门的名词，在各种各样的解决方案、白皮书中经常都能</P>
<P>看到即插即用这么几个字，但真的又有多少软件做到了呢，当然，不可否认的是也有部分的软件确实做到</P>
<P>了，而且做的很好，例如Eclipse，知名的插件式系统，还有象maven这些都是，其实portlet container</P>
<P>那些也都是的，列举出来还真的有不少。插件式系统带来的好处很明显，最大程度的重用，为快速的搭建</P>
<P>系统提供帮助，潜在的好处在于要求系统以插件式的方式进行设计，帮助你更好的做到模块化的划分以及</P>
<P>帮助系统达到良好的封装性。</P>
<P><FONT style="BACKGROUND-COLOR: #008000" color=#ffffff size=5>需求<BR></FONT>要做Plugin Architecture，首先需要做的是如何考虑Plugin，其实也就是需求，要看你是怎么看待一个</P>
<P>Plugin的，认为一个Plugin应该是怎么样的，认为Plugin是怎么样被组装起来构成系统的，这个时候需要</P>
<P>的是大家从需求的角度来提出要求，不要从技术角度来提。一个系统既然是按照Plugin的方式搭建出来，</P>
<P>那么首先需要知道的是就是Plugin能提供什么样的功能，这些功能需要什么参数，这是最基本的，其次是</P>
<P>如何去管理这个Plugin，包括修改它的配置参数，对它的生命周期进行管理(启动/暂停/停止等)，这是以</P>
<P>单独的Plugin角度来看，如果这个Plugin又得调用其他Plugin提供的功能，那么应该怎么去做，考虑了这</P>
<P>些后又会想到Plugin应该怎么去部署、怎么去自动升级。从扩展方面我们又会考虑到那么我要如何去扩展</P>
<P>一个Plugin呢，这也是很关键的。这都只是简简单单的提了一些Plugin的需求，归纳上面的需求可以得出</P>
<P>主要的几点就是Plugin的功能的暴露、Plugin的管理、Plugin的调用、Plugin之间的协作、Plugin的部署</P>
<P>、Plugin的扩展这几个大的方面。</P>
<P><FONT style="BACKGROUND-COLOR: #008000" color=#ffffff size=5>技术简介</FONT><BR>现有的可参考的Plugin Architecture还是有比较多的，例如Eclipse、Geronimo、Maven、Pluto等等，这</P>
<P>些都是做的比较好的插件式的系统，在这里主要讲讲Eclipse如今使用的Osgi和Geronimo所使用的JMX+IoC</P>
<P>方式实现的Plugin Architecture，应该说两者各有千秋，重点还是看对于Plugin的需求到底是怎么样的</P>
<P>，Osgi规范将系统按照Bundle的方法进行组装，每个Bundle下包含了一系列的Service，通过编写Bundle</P>
<P>完成对于Bundle的管理(Start、Stop)，而Service则为Bundle所能提供对外的功能，通过MANIFEST.MF这</P>
<P>个标准的jar包描述文件来描述bundle所能提供的功能以及一些元数据信息，由于对Osgi研究不深，也只</P>
<P>能大概的提提这些了，Eclipse在3.0以后的版本开始采用Osgi，并兼容其原有的Plugin方式，可以通过阅</P>
<P>读Eclipse源码去了解关于基于Osgi来实现Plugin Architecture的方式，Eclipse是基本实现了上述需求</P>
<P>部分的，不过个人认为在plugin的管理、plugin之间的协作、plugin的部署上还可以加强；接下来提提</P>
<P>JMX+IoC方式，对JMX稍有了解的人都知道JMX被大量的应用服务器所使用，如Jboss、Tomcat、Weblogic、</P>
<P>WebSphere等等，数不胜数，JMX强调的是一个管理概念，对JMX不在此详细的介绍，但其实它同样是一个</P>
<P>Plugin的概念，依照JMX系统可以编写MBean的方式来暴露Plugin的功能，并实现对于Plugin的管理(各种</P>
<P>方式，http、rmi等等)、Plugin的调用、Plugin的部署，那么为什么要引入IoC呢，IoC帮助实现Plugin之</P>
<P>间的协作，并且是通过注入的方式来实现，IoC也不在这里详细的去描述了。</P>
<P><FONT style="BACKGROUND-COLOR: #008000" color=#ffffff size=5>总结</FONT><BR>通过对上面两种实现Plugin Architecture的简介，分别都实现了需求中的内容，但都有提升的余地，个</P>
<P>人认为Osgi的方式需提升对于Plugin管理的关注(不仅是生命周期管理)、而JMX+IoC方式则需提高对于</P>
<P>Plugin内部结构的关注(就象Osgi将Plugin分解为了Bundle和Service)，至于Plugin的扩展方面觉得</P>
<P>Eclipse的Extension Point是非常不错的一个设计，不过同时也看出在Plugin Architecture的实现上基</P>
<P>本都采用了管理和静态结构分离的方法，其实这个好处是非常明显的，可以快速的将系统原有的模块通过</P>
<P>编写一个管理类的方法就可作为plugin放入系统中，这提升了简便性，当然最大的作用还是分清了职责，</P>
<P>说一句题外话，职责单一一直是软件设计的重中之重，此文纯属抛砖引玉，希望能听到更多关于Plugin </P>
<P>Architecture的声音，也希望大家都关注Plugin Architecture，最近也出了一个JPF，不知道大家是否有</P>
<P>所了解。</P><img src ="http://www.blogjava.net/BlueDavy/aggbug/6925.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-06-30 11:02 <a href="http://www.blogjava.net/BlueDavy/archive/2005/06/30/6925.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>由Windows服务想到的</title><link>http://www.blogjava.net/BlueDavy/archive/2005/06/03/5544.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Fri, 03 Jun 2005 15:17:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/06/03/5544.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/5544.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/06/03/5544.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/5544.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/5544.html</trackback:ping><description><![CDATA[在服务的每一项不是有关于这个服务所依赖的服务吗？发现其实这是在JAVA的结构体系中一直缺乏的，没法直接看出依赖关系来，觉得这种其实对于组件化或者说构件化的系统来说是非常重要的 ，况且现在已经到了Java软件体系开发中对于插件化越来越重视的年代，现在真的是看N多的Java的东西都有一句本系统是插件化的，觉得插件化虽然是做的不错了，但发现自己竟然没真正去做过一个合格的插件化系统的开发或者说基于一个合格的插件式平台做二次开发，唉，这也是个失败，象Maven 2里也有一句话：Every thing&nbsp;in maven2&nbsp;is a plugin.<BR>应该说，Microsoft的东西还是做的不错的，虽然总是有说它不稳定，Bug多等等，但不可否认的是，Microsoft的软件是全世界最为成功的软件，想想它的多少东西在被人使用着，唉，而且用Office以来，真的是越来越觉得Microsoft的强大，在用Office的时候我常说的是经常是我想不到却很实用的功能，它都做到了，真是没话说，我们不从技术上去做评价，其实面向普通用户的软件从技术上去评价是没什么意义的，关键是好不好用，可以说，Microsoft的大部分东西都具有良好的用户体验和交互性<BR>今天在看别人做的一个Workflow系统的时候就有这么样的感想，是，那套系统的技术真的可以说很烂，但又怎么样？它已经足够能满足客户的要求了，客户需要的就是这样的系统，你技术再先进又怎么样，对于客户来言还不是一个一样的系统，而且技术采用的太先进往往导致的就是什么都做不出来的后果，当然，也不是说不去关注技术走向。<img src ="http://www.blogjava.net/BlueDavy/aggbug/5544.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-06-03 23:17 <a href="http://www.blogjava.net/BlueDavy/archive/2005/06/03/5544.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如果要你选插件式开发平台，会选一个怎么样的呢？</title><link>http://www.blogjava.net/BlueDavy/archive/2005/05/26/5236.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Thu, 26 May 2005 13:43:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/05/26/5236.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/5236.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/05/26/5236.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/5236.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/5236.html</trackback:ping><description><![CDATA[如果要你选一个插件式开发平台，你会选一个怎么样的呢？会有什么需求呢？？？<BR>我是这么想的：<BR>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><BR>可快速开发一个插件，尽量少的对现有系统的侵入。在此平台上可快速的进行插件的开发，尽量减少对于系统的侵入，有良好的开发向导和开发</SPAN><SPAN lang=EN-US>IDE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可轻松的进行插件的部署。当开发完毕一个插件需要部署至平台上时，此步骤应尽量的简单。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简单的调用其他插件。对于平台中其他可用的插件的调用应尽可能的依赖并保持插件的独立性。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简单的被调用。其他插件或应用需要调用时应可简单的被调用。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可进行测试、调试。可进行单元测试、调试，使得开发时更加的简便。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可被扩展。插件可被扩展，方便将来可对此插件进行功能上的完善和改进。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可分布式的部署，并支持多种方式调用</SPAN><SPAN lang=EN-US>(Webservice</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>JMS)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。使得插件可部署在远端，实现分布式的物理结构。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可自动的升级。插件可自动的升级，减小对于插件的维护并保证插件功能的最新。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可被管理，安装、卸载、启用和暂停使用。使得用户可对插件进行选择性的配置。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件异常的管理。保证插件在产生任何异常的情况下均可对其进行捕捉并友好的提示用户。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.25pt; LINE-HEIGHT: 150%"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插件日志。在插件的使用过程中记录下足够的日志，方便将来对于插件的分析。</SPAN></P><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">&nbsp;&nbsp;&nbsp; 产生的数据可被其他插件使用。在插件中产生的信息数据可被共享，使得各插件产生的数据可共同构成系统的信息<BR>&nbsp;&nbsp;&nbsp;&nbsp;网络，信息得以被共享。</SPAN><BR><img src ="http://www.blogjava.net/BlueDavy/aggbug/5236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-05-26 21:43 <a href="http://www.blogjava.net/BlueDavy/archive/2005/05/26/5236.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于Plugin Framework的关键因素</title><link>http://www.blogjava.net/BlueDavy/archive/2005/05/25/5187.html</link><dc:creator>BlueDavy</dc:creator><author>BlueDavy</author><pubDate>Wed, 25 May 2005 07:42:00 GMT</pubDate><guid>http://www.blogjava.net/BlueDavy/archive/2005/05/25/5187.html</guid><wfw:comment>http://www.blogjava.net/BlueDavy/comments/5187.html</wfw:comment><comments>http://www.blogjava.net/BlueDavy/archive/2005/05/25/5187.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/BlueDavy/comments/commentRss/5187.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/BlueDavy/services/trackbacks/5187.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin System</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">现在的流行程度已经勿庸置疑了，在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">N</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">多的白皮书、解决方案中都可以看到即插即用这样的词语，而市场上面向构件、插件的软件也是越来越多，其实插件式的组装系统或者说</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">”</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">搭积木</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">”</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">式的组装系统一直就是软件界的追求，但对于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin System</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">还是有些迷惑的地方，还望大家一起讨论讨论，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">^_^</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，目前的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">基本都是一种</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Kernel+Core Plugins</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">组成的结构体系，说出来就是</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">all are plugins</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">^_^</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，典型的就如</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Eclipse</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，其实</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Maven</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">也算的上的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">通常一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的职责就是：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">1、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">搜索相应目录，并将目录下可作为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的部分注册到</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">中</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">2、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">提供外部调用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的方法</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">3、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">之间相互交互的方法</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">4、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的加载，根据其描述构建相应的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">ClassLoader<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">5、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的编写说明</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">当然，一个好的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">应该还提供</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">开发向导，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">开发、调试、部署的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">IDE</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">等等</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">主要希望就下面几点来进行讨论，呵呵，当然，大家也可以增加一些大家认为值得讨论的部分：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">1、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的编写</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">你构思中一个好的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin System</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">会要求</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">如何编写，我考虑中一个好的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin System</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">对</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">没有任何编码上的要求，要求的只是其描述文件的编写。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">2、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的部署</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的部署，如何更加方便的去部署一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，就象</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Osgi</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">可以通过网络访问等等，考虑中根据配置从相应的目录或网站搜索</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">并注册到系统中</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">3、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的调用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">对于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的调用，根据</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的描述采取相应的方式调用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，例如</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">webservice</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">方式、</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">socket</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">方式等等</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">4、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的交互</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">对于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的交互，也许可以参考</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Maven</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的方式，比如需要调用其他的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">，则采用类似这样的配置或调用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">&lt;attain plugin=”pluginname” function=”sendmail”/&gt;<SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">抑或采用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">IoC</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">容器注入依赖？？</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">5、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的扩展</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">对于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的扩展，这个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Eclipse</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的扩展点完全值得参考</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 39.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><SPAN style="mso-list: Ignore">6、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial">的依赖关系的分析</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这是我构思中的一个东西，希望系统所有的模块都基于此</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">，然后我们可以根据这些模块</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Plugin</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">来分析整个系统<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;中各模块的依赖关系等等，并进行监控，甚至在将来可以图形化的进行配置，图形化搭积木式的搭建自己的系统，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">^_^<BR><BR><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">也希望能听到大家关于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">技术方面的更多东西，例如采用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Osgi</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">实现</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Plugin Framework</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">的实现思路等等</SPAN></SPAN><img src ="http://www.blogjava.net/BlueDavy/aggbug/5187.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/BlueDavy/" target="_blank">BlueDavy</a> 2005-05-25 15:42 <a href="http://www.blogjava.net/BlueDavy/archive/2005/05/25/5187.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>