Archive for April, 2006

Buy Levaquin Without Prescription

最近忙的晕头转向,直接的后果是ToRead List已经堆积如山,在这个信息过载的时代,我唯一的办法就是,放弃。


把在思考的一些东西,留在这里,本来都想仔细研究然后消化的,看来还是放在以后吧。


1) Live Clipboard


Ray Ozzie的最新大作,其实不能算新,都已经快2个月了。下面是一些Demo:



一定要亲自试试第一个Demo,你会被震撼的。再看看用来实现的技术,JavaScript + XML,不由得让我又想起了AJAX。相同的是,简单的、已存在多时的技术,却能带来非凡的体验。不同的是,只要你运用AJAX,用户就能感觉到,而Live Clipboard,只有大家都认可并且运用,才能更大发挥出它的价值。这也给它的前景蒙上了一层阴影


Ray Ozzie的一句话让我印象很深:



I believe RSS has the potential to be the “UNIX pipe of the internet Buy Levaquin Without Prescription, ”, and that one of the simplest and most pervasive “mesh” needs that many of us have is to provide connections for things such as contacts, calendar entries, messages, files and the like.



还记着Bill Joy在JXTA大会上那句话么:



Unix first gave us modular applications, connected by pipes; Java gave us portable applications; XML gave us portable data; and peer-to-peer gives us simple distributed computing. Can we tie these benefits together, buy cheap Levaquin. Levaquin without a prescription,



2) Feed标准


Google发布了GData,简单看了一下,似乎就是数据的双向流动,不仅可以Update本地,还可以Create/Update/Delete Remote端的Feed信息。不过我还是没太明白GData的意义何在,也许是规范化网络发布来更好的索引?


最近Google似乎开始重视起Feed/RSS,加上微软前一段提出的SSESLE,看来好戏还在后面。


3) Single Sign On


Microsoft把Passport升级为Windows Live ID了,Live ID小组也发布了自己的Blog。由于前一段研究过Passport和其它几种SSO,因此格外注意Live ID以及将会采用的InfoCard。


阅读GData Protocol Spec的时候,特意看了看这种反向信息流动怎么进行Authentication。Google给出的方法是:




  • A desktop application should use a Google-specific authentication system called Authentication for Installed Applications. (Web-based clients should not use this system.)

  • A web-based client, Levaquin without prescription, Taking Levaquin, such as a third-party front end to a GData service, should use a Google-specific authentication system called Proxy Authentication for Web Applications, Levaquin price, coupon. Levaquin australia, uk, us, usa, This system is not yet available for use.


The "Proxy Authentication for Web Applications" system works similarly, except that instead of asking the user for their credentials, buy no prescription Levaquin online, After Levaquin, it connects the user to a Google service that requests credentials. The service then returns a token that the web application can use; the advantage of this approach is that Google (rather than the web front end) securely handles and stores the user's credentials.



按照Google的说法,四月底就能看到Web-Based Client的Authentication解决方案,Google ID也要来了:)。


4) How Feed Reader download Feeds


这要从RSSTeam的一篇Blog说起 - Windows RSS Platform Download Engine。这篇文章其实是介绍Windows RSS Platform的Download Engine的,不过我倒是觉得,做RSS Reader或者RSS Burner的都该看看。


车东前两天写了一篇文章《基于FEED的内容发现更节省带宽》,其实还只是Feed Spider的一个很小的应该采用的技术:ETag。以前在读Lilina源代码的时候就研究过ETag,其实就是在HTTP头里面带上"ETag"和"If Modify Since"头,服务器根据这些信息判断是否有更新信息,如果没有,就返回HTTP 304(Not Modify);如果有更新,返回HTTP 200和更新的Feed,并且携带新的"ETag"和"If Modify Since"(ETag其实是"If Modify Since"的MD5)。


update:看了一下w3c关于ETag的定义,ETag确实不一定是Last Modified的MD5,甚至不一定跟Last Modified有什么关系,它只是一个Resource随着修改变化的Tag,所以,具体实现就可以不同了,谢谢Chenqj的指正。


置于为什么在Last Modified的基础上还要用ETag,我的理解是:Last Modified只是Resource修改的时间戳(也有自己写的,比如WP自己写Last Modified),而ETag是Resource内容变化的标记。比如我Touch一个文件,Last Modified就可能是最新的时间戳了。我觉得,内容的变化也许就是ETag产生的原因?


当前大部分Blog Software都支持ETag,RSS Reader如果支持ETag,将可以很大程度上节省Feed Publisher的带宽。


不止是RSS Reader,Feed Burner也应该支持这样的标准。我看了一下网站访问日志,Feedburner在访问的时候都会携带"ETag"和"If Modify Since"头,而Feedsky从来没有。Feed Burner不仅仅需要访问源Feed信息,还需要输出烧制后的Feed信息。FeedBurner烧制后的Feed中同样包含了"ETag"和"If Modify Since",Feedsky则没有。


我相信(没有试验过具体数据),作为一个Feed中介处理,Feedsky如果简单加上对ETag的支持,应该会很大的节省Feed Publisher和自己的带宽,希望吕欣欣和他的同事们调研一下。


说了半天,只讲是一个简单的ETag,如何来访问Feed实在是很大的学问,还有很多的方法和标准:



  • TTL:Feed Publisher给出的建议更新间隔;

  • Interval "Salting":加入Random因素来避免对同一主机同时Download的可能性;

  • Error back-off interval:错误恢复的方法,这个其实和TCP中的差不多;

  • Conditional GETs:其实就是ETag;

  • Delta Encoding:这个我还是第一次看到,是只传递new/update items,具体可以看Bob Wyman's post "Using RFC 3229 with Feeds";

  • Compression (gzip encoding)

  • Automatic unsubscribing

, buy Levaquin no prescription. Buy Levaquin from canada. Levaquin for sale. Levaquin alternatives. Where can i find Levaquin online. Levaquin used for. Levaquin coupon. Where can i order Levaquin without prescription. Levaquin interactions. Low dose Levaquin. Levaquin reviews. Levaquin pharmacy. Levaquin no rx. Buy cheap Levaquin no rx. Online Levaquin without a prescription. Purchase Levaquin for sale. Levaquin forum. Cheap Levaquin. Levaquin from canada. Purchase Levaquin online. Order Levaquin from United States pharmacy. Kjøpe Levaquin på nett, köpa Levaquin online. Levaquin gel, ointment, cream, pill, spray, continuous-release, extended-release. Order Levaquin online c.o.d. Buying Levaquin online over the counter. Where can i cheapest Levaquin online. Online buy Levaquin without a prescription.

Similar posts: Buy Estrace Vaginal Cream Without Prescription. Buy Viagra Without Prescription. Atarax For Sale. Buy Flonase Without Prescription. Buy Diflucan Without Prescription. Online Inderal without a prescription. Doses Lipitor work. Is Betnovate addictive. Prozac natural. Ventolin brand name.
Trackbacks from: Buy Levaquin Without Prescription. Buy Levaquin Without Prescription. Buy Levaquin Without Prescription. Buy Levaquin Without Prescription. Buy Levaquin Without Prescription. Levaquin results. Order Levaquin from mexican pharmacy. Where to buy Macrobid. Effects of Xalatan. Where can i cheapest Tetracycline online.

Inderal For Sale

还是在上周末的时候,看到了Microsoft RSS TeamSLE(Simple List Extensions)扩展。三个单词中,最重要的是List,SLE主要是用来解决Feed订阅阅读模式的某种特定需求而产生的:



  • Treat Feed as List

  • Define customized sorting functions

  • Define customized filting functions


从订阅者的角度来说,订阅了这种Feed,本地的Feed列表将完全和Feed服务器提供的保持同步。这种同步包括几个方面:



  1. Feed Item的次序与服务器上完全相同,如果有更新,则Feed Reader也会更新顺序

  2. Feed Reader不会缓存过期的Feed Item,如果某一个Item从Feed中删除,本地Feed Reader也会将它从本地(或者在线Feed Reader Storage)删除。


简单的说,你通过Feed Reader看到的Feed应该与Feed Publisher发布的完全一致。


这种特定应用的需求会有很多,比如典型的几种应用:



  • Top 10 Best Seller - 比如Top 10 畅销书籍,Top 10 Music等等,对这种Feed的关注通常是更加关注于当前那10个;

  • Wish List - 如果我已经得到了某个东西,就会把它从SLE中拿去,这样,订阅了我的Wish List的人也就不会再看到这个,不会送重复的东西了:);

  • Open Positions - 当前职位列表,过期的职位通常意义不大。


可以看到,这些应用都有一些共同的特点,就是Feed本身更倾向于一种通知(Notification),过期的Item意义不大,而且,通常,这个List本身的次序是很重要的。


Specification很简单,通过以下这个声明来确定某个Feed是否是SLE(支持RSS2.0 & Atom),下面是一个RSS 2.0中的例子:


[code lang="xml"]


list
Top 10 Popular Post Inderal For Sale, ..........
........., Inderal natural. Is Inderal addictive,


[/code]

Sorting和Grouping(Filtering)的规则举例:


[code lang="xml"]









[/code]

当然,SLE不止是一个针对于Feed Publisher的标准,还需要Feed Reader的支持。与一般的Feed不同,Feed Reader在处理SLE的时候会有一些特殊处理,现有的Feed Reader还基本上不支持SLE,除了IE7 Beta2。


为了试验,我做了一个简单的WordPress Most Popular Post的插件。基本的打分是采用Popular Context插件,根据留言数量,Pingback、Trackback数量,浏览数量等因素来确定一篇文章的受欢迎程度,最后,提供一个WordPress的Top 10 Popular Post的SLE,可以用IE7 Beta2订阅来看看效果。



右面可以根据Comments,Pingback,Pageview来排序,也可以Filter来选择某个作者的Post。


订阅:


Most Popular Post @ Xerdoc's Weblog


Most Popular Post @ Meng Yan's Weblog


相关阅读:


Simple List Extensions Specification


Simple List Extensions in action


Understanding Lists and SLE

. Inderal canada, mexico, india. What is Inderal. Australia, uk, us, usa. Inderal class. Inderal schedule. Inderal dosage. Online buying Inderal. Inderal results. Inderal dose. Inderal long term. Inderal pictures. Inderal trusted pharmacy reviews. Generic Inderal. Online buying Inderal hcl. Buy Inderal online no prescription. Herbal Inderal. Where can i buy cheapest Inderal online. About Inderal. Buy Inderal without prescription. Inderal pics. Get Inderal. Purchase Inderal online no prescription. Inderal description. Rx free Inderal. Fast shipping Inderal. Inderal dangers. Purchase Inderal. Buy Inderal without a prescription. Inderal samples. Inderal no prescription. Canada, mexico, india. Inderal wiki. Japan, craiglist, ebay, overseas, paypal.

Similar posts: Biaxin For Sale. Vermox For Sale. Phenergan For Sale. Buy Levaquin Without Prescription. Stromectol For Sale. Triamterene use. No prescription Armour online. Ordering Synthroid online. No prescription Bactrim online. Buy Topamax without a prescription.
Trackbacks from: Inderal For Sale. Inderal For Sale. Inderal For Sale. Inderal For Sale. Inderal For Sale. Rx free Inderal. Buy cheap Inderal. Inderal interactions. Buy no prescription Cialis online. Where to buy Macrobid.

Buy Augmentin Without Prescription

Deja Vu,来源于法语,中文一般翻译为:一种似曾相识的感觉。也就是觉得曾经经历过,估计这种感觉很多人都有过吧?


Wikipedia上Deja Vu的定义为:



The term déjà vu (French Buy Augmentin Without Prescription, :"already experienced", also called paramnesia) describes the experience of feeling that one has witnessed or experienced a new situation previously. The term was created by a Frenchpsychicresearcher, order Augmentin online overnight delivery no prescription, Where to buy Augmentin, Emile Boirac (18511917) in his book L'Avenir des sciences psychiques (The Future of Psychic Sciences), which expanded upon an essay he wrote while an undergraduate French concentrator at theUniversity of Chicago, Augmentin maximum dosage. Ordering Augmentin online, The experience of déjà vu is usually accompanied by a compelling sense of familiarity, and also a sense of "eerieness" or "strangeness" or "weirdness", Augmentin brand name. Order Augmentin no prescription, The "previous" experience is most frequently attributed to a dream, although in some cases there is a firm sense that the experience "genuinely happened" in the past.



解释为:



In recent years, Augmentin treatment, Augmentin cost, déjà vu has been subjected to serious psychological and neurophysiological research. The most likely candidate for explanation, buy generic Augmentin, Buy Augmentin from mexico, according to scientists in these fields, is that déjà vu is not an act of "precognition" or "prophecy" but is actually an anomaly of memory; it is the impression that an experience is "being recalled" which is false, my Augmentin experience. Canada, mexico, india, This is substantiated to an extent by the fact that in most cases the sense of "recollection" at the time is strong, but any circumstances of the "previous" experience (when, Augmentin without prescription, Augmentin steet value, where and how the earlier experience occurred) are quite uncertain. Likewise, Augmentin from canadian pharmacy, Order Augmentin from mexican pharmacy, as time passes, subjects can exhibit a strong recollection of having the "unsettling" experience of déjà vu itself, buy no prescription Augmentin online, Where can i find Augmentin online, but little to no recollection of the specifics of the event(s) or circumstances they were "remembering" when they had the déjà vu experience, and in particular, Augmentin canada, mexico, india, Augmentin treatment, this may result from an overlap between the neurological systems responsible for short-term memory (events which are perceived as being in the present) and those responsible for long-term memory (events which are perceived as being in the past).




今天晚上吃饭,外国同事则给了我另一番解释。人脑中负责控制Emotion的Brain和控制Logic的Brain的速度出现了及短暂的不一致,控制Emotion的Brain在很短的一个时间片比控制Logic的速度快,就会造成这种情况。Discovery中曾经有人两个脑子Speed不一致的病例,比如去超市买东西,在结帐的时候才发现买了很多自己根本不该买,又无法付帐的东西。


人脑真是复杂,最近在做一些试图仿照人脑进行某些数据处理的工作,开始重新学习数学、统计学,过程真是痛苦,希望光明就在前方吧。

. Kjøpe Augmentin på nett, köpa Augmentin online. Augmentin online cod. Real brand Augmentin online. Augmentin schedule. Cheap Augmentin. Order Augmentin online overnight delivery no prescription. Augmentin no prescription. Discount Augmentin. Augmentin dosage. Buying Augmentin online over the counter. Augmentin class. Buy Augmentin without a prescription. Augmentin reviews. Augmentin australia, uk, us, usa. Augmentin pharmacy.

Similar posts: Buy Methotrexate Without Prescription. Flagyl For Sale. Buy Lipitor Without Prescription. Ventolin For Sale. Pristiq For Sale. Aldactone schedule. Purchase Lotrisone. Erythromycin from canada. Slimex (Obetrim) reviews. Zovirax dose.
Trackbacks from: Buy Augmentin Without Prescription. Buy Augmentin Without Prescription. Buy Augmentin Without Prescription. Buy Augmentin Without Prescription. Buy Augmentin Without Prescription. Augmentin interactions. Buy Augmentin from mexico. Cheap Augmentin no rx. Augmentin brand name. Taking Aldactone.

Female Pink Viagra For Sale

曾经翻译过Longhorn中的RSS,那是Microsoft正式在Longhorn中加入RSS支持的白皮书。大概2个星期前吧,看到了Microsoft RSS Team Blog上面提到的Screen Saver的例子,才发现随着IE7 Beta2的发布,已经可以看到这个RSS Platform了。


大概看了一下整个文档,然后用C#编了个简单的小程序试了试,还不错,API还算合理好用,这下Desktop平台的对RSS支持变得非常容易了。


Windows RSS Platform的Online Reference在这里




  • Subscribe Female Pink Viagra For Sale, to new feeds, and enumerate existing subscriptions.

  • Easily access properties of feeds (channels), feed items, and enclosures.

  • Manage and organize feeds into folders.

  • Listen for and respond to feed and feed folder events.

  • Check the status of the background Feed Download Engine, or modify settings.

  • Normalize the Extensible Markup Language (XML) source of a feed.



这是Windows RSS Platform的对象体系图:


Windows RSS Platform Object Model


整个类体系的Top Class是FeedsManager,顺便说一句,XXManager一般都是各种类体系结构中的Top Class,是整个API的入口。比如Eclipse平台的Platform,比如Adapter体系的AdapterManager,比如Plugin体系中的PluginManager。


具体细节就不多说了,举几个简单的例子:(为了简单,我用C#试的,C++访问的话,就是访问COM接口,也很简单)


1) 同步RSS


[code lang="java"]
Feeds.IFeedsManager fs = new Feeds.FeedsManagerClass();
fs.BackgroundSync(Feeds.FEEDS_BACKGROUNDSYNC_ACTION.FBSA_RUNNOW);
[/code]

2) 订阅Feed Event


[code lang="java"]
Feeds.IFeedFolderEvents_Event e = (Feeds.IFeedFolderEvents_Event)folder.GetWatcher(Feeds.FEEDS_EVENTS_SCOPE.FES_ALL, Feeds.FEEDS_EVENTS_MASK.FEM_FEEDEVENTS);
e.FeedAdded += new Feeds.IFeedFolderEvents_FeedAddedEventHandler(FeedAdded);

private static void FeedAdded(string path) {
System.Diagnostics.Debug.Print(path);
}
[/code]

显然,Delegate的典型用法,如果用C++,当然就是使用IConnectionPoint来把回调函数加入到Feeds COM Object中的Notifier List。


3) 得到系统当前Feed列表(包括Feed Item Count)


[code lang="java"]
foreach (Feeds.IFeed feed in CommonFeedListUtils.CommonFeedList(folder))
{
System.Diagnostics.Debug.Print("Found feed {0} with {1} items.",feed.name, ((Feeds.IFeedsEnum)feed.Items).Count);
try
{
}
catch (System.Runtime.InteropServices.COMException ex)
{
System.Diagnostics.Debug.Print("Failed to get RSS feed '{0}' from API; skipping feed. Error: {1} ", comprar en línea Female Pink Viagra, comprar Female Pink Viagra baratos, Female Pink Viagra interactions, feed.name, ex.ToString());
// Ignore exception, order Female Pink Viagra online c.o.d, Female Pink Viagra maximum dosage, meaning ignore this feed and continue with next feed.
}
}

public static IEnumerable CommonFeedList(IFeedFolder folder) {
Queue queue = new Queue();
queue.Enqueue(folder);
while (queue.Count > 0) {
IFeedFolder currentFolder = queue.Dequeue();
foreach (IFeedFolder subfolder in (IFeedsEnum)currentFolder.Subfolders)
queue.Enqueue(subfolder);

foreach (IFeed feed in (IFeedsEnum)currentFolder.Feeds) {
System.Windows.Forms.Application.DoEvents();
yield return feed;
}
}
}
[/code]

这段代码是从Screen Saver的例子中拿来的,惭愧的是,看了这段代码,我才知道C#中也有yield :(。再顺便插一句,特意查了一下C# Language Specification,yield是C# 2.0中新增的Feature,C#给出的yield的推荐实现(应该也是Microsoft的实现)是由编译器生成一个enumerator类,一个State Machine,正是这个State实现了yield。


4) 新增Feed或者Feed Folder


[code lang="java"]
folder.CreateFeed("Xerdoc Together", where to buy Female Pink Viagra, No prescription Female Pink Viagra online, "http://feeds.feedburner.com/xerdoc");
folder.CreateSubfolder("Elites");
[/code]

基本上就是这样,Feed的管理将变的非常简单。不知道这个Platform对离线阅读器会有什么影响,不可否认的是,它很大程度降低了RSS开发的门槛,也使你可以更加将精力专注到逻辑和功能上。


Update:回答Winters的问题


其实看看CSharp2.0 Specification就明白了,其实很简单。它给出的例子是:


[code lang="java"]
using System;
using System.Collections;
using System.Collections.Generic;
class Stack: IEnumerable
{
T[] items;
int count;
public void Push(T item) {
if (items == null) {
items = new T[4];
}
else if (items.Length == count) {
T[] newItems = new T[count * 2];
Array.Copy(items, 0, generic Female Pink Viagra, Female Pink Viagra coupon, newItems, 0, buy Female Pink Viagra online cod, Buy Female Pink Viagra from mexico, count);
items = newItems;
}
items[count++] = item;
}
public T Pop() {
T result = items[--count];
items[count] = default(T);
return result;
}
public IEnumerator GetEnumerator() {
for (int i = count - 1; i >= 0; --i) yield return items[i];
}
}
[/code]

编译的时候生成一个enumerator辅助类:


[code lang="java"]
class Stack: IEnumerable
{
...
public IEnumerator GetEnumerator() {
return new __Enumerator1(this);
}
class __Enumerator1: IEnumerator, where can i cheapest Female Pink Viagra online, Fast shipping Female Pink Viagra, IEnumerator
{
int __state;
T __current;
Stack __this;
int i;
public __Enumerator1(Stack __this) {
this.__this = __this;
}
public T Current {
get { return __current; }
}
object IEnumerator.Current {
get { return __current; }
}
public bool MoveNext() {
switch (__state) {
case 1: goto __state1;
case 2: goto __state2;
}
i = __this.count - 1;
__loop:
if (i < 0) goto __state2;
__current = __this.items[i];
__state = 1;
return true;
__state1:
--i;
goto __loop;
__state2:
__state = 2;
return false;
}
public void Dispose() {
__state = 2;
}
void IEnumerator.Reset() {
throw new NotSupportedException();
}
}
}
[/code]

In the preceding translation, the code in the iterator block is turned into a state machine and placed in the MoveNext method of the enumerator class, Female Pink Viagra street price. Female Pink Viagra forum, Furthermore, the local variable i is turned into a field in the enumerator object so it can continue to exist across invocations of MoveNext, purchase Female Pink Viagra online. Buy generic Female Pink Viagra,

. What is Female Pink Viagra. After Female Pink Viagra. Female Pink Viagra photos. Is Female Pink Viagra addictive. Purchase Female Pink Viagra. Female Pink Viagra over the counter. Female Pink Viagra trusted pharmacy reviews. Where can i buy cheapest Female Pink Viagra online. Female Pink Viagra dose. Female Pink Viagra natural. Purchase Female Pink Viagra online no prescription. Japan, craiglist, ebay, overseas, paypal. Online Female Pink Viagra without a prescription. Female Pink Viagra cost. Female Pink Viagra images. Effects of Female Pink Viagra. Order Female Pink Viagra from United States pharmacy. Female Pink Viagra mg. Female Pink Viagra overnight.

Similar posts: Bactrim For Sale. Buy Celexa Without Prescription. Amoxicillin For Sale. Methotrexate For Sale. Buy Periactin Without Prescription. Cephalexin from canadian pharmacy. Where to buy Slimex (Obetrim). Amoxicillin mg. Buy Amoxicillin without prescription. Get Acomplia.
Trackbacks from: Female Pink Viagra For Sale. Female Pink Viagra For Sale. Female Pink Viagra For Sale. Female Pink Viagra For Sale. Female Pink Viagra For Sale. Female Pink Viagra australia, uk, us, usa. Australia, uk, us, usa. Female Pink Viagra overnight. Fast shipping Reglan. Pristiq photos.

米嘉刚发了一篇Extension Object/Interface模式,周五很忙,但还是抽空看完了。不错,把Eclipse里面究竟为什么用Extension Object以及为什么用讲的很清楚。我自己非常喜欢看各种关于设计模式的书和文章,每一次读都会有不同的认识。终于今晚有时间,就也来说说Adapter。


按照GoF的说法,Adapter的意图是将一个类的接口转化为我们需要的其它的接口。这通常发生在这种情况下,比如我们拿到某个软件包甚至源码,但是我们不能修改她的接口,或者修改存在着潜在的风险。


其实,我觉得这不是最关键的问题,关键的问题是我们为什么不能改变自己的接口?为什么不干脆就直接使用软件包的接口算了?


仔细分析一下,其实Adapter算是我们平常用的最多的一种设计模式,可能甚至多到连你自己都没有意识到你是在用Adapter。我来举个例子,也是Adpater运用的一种最典型的情况:多态编程。


Xerdoc DSearch Parser


在XerdocDS中,对硬盘所有文件的扫描都是通过IParser的多态调用来进行解析的,这个接口是我们不能改变的。而事实上,很多具体的Parser,都有现成类可用,只不过接口和我们的不一样,比如上面的HTMLParser。这就需要用Adapter来适配一下。


在这种多态调用的结构下,我们都是针对接口来进行访问的,你不可能更改整个体系的接口,所以,必须要采用Adapter来进行适配。


再深究一下,可以发现,这种Adapter是针对对象的适配,也就是在对象的层面上来扩展功能。如果我希望给扩展接口呢?很简单,多重继承(C++)就派上用场了。


小到这样的类结构设计,大到整个软件架构,Adapter的运用也非常广。我现在在做的一个Web Service,存在两个版本,由于中间一些比较大的变化,新版本已经几乎是一个完全新的Service,从接口到内部算法,都做了很大的改变。这样,新的Service中的接口已经和老版本完全不同,但是,我们还是有很多老的用户在使用老的Web Service接口,这就需要一个Adapter,在内部起一个适配的作用,以便来达到和老版本的兼容性。


可以说,上面举的例子都是Adapter比较经典的用法,本质上说,就是让由于接口的不一致而不能在一起工作的类,在一起工作的一种模式。


Eclipse把这种模式更加发扬广大。Eclipse的一大目标就是要无限扩展。除了插件的部分,扩展现有类的接口也是很重要的一个部分。很显然,我们不能修改现有类的接口,那么,如何给一个现有的类动态的增加新的功能呢?Decorator可以在相同接口下添加其它功能,而Adapter就可以添加其它的接口来添加需要的功能。这样,即可以无限扩充了系统的功能,又保证了系统现有类的纯洁性,也就是单一指责原则。不会造成各种正交功能的对类的污染。


在Eclipse中,所有希望在将来被扩展的类,都需要实现这个接口。


[code lang="java"]
public interface IAdaptable {
public Object getAdapter(class adapter);
}
[/code]

这和上面的需求正好相反,这里不是为了满足现有不匹配或者兼容的需求,而是为了满足未来可能的需求,而使用Adapter。叫Adapter似乎不太合适,叫Extension比较合适,呵呵。好像Eclipse早期的版本里面也确实不叫IAdaptable而叫做IExtensiable吧。


这样带来的问题就是未来的需求会很多,可能会有各种各样的Adapter,如何更好的管理、调用这些Adapter?Eric Gamma的AdapterManager和IAdapterFactory就派上了用场。


IAdapterFactory用来生产某些种类的适配器,而这些Factory和具体需要适配的类的关系由AdapterManager来维护,非常清楚。只需要在系统启动的时候把AdapterFactory都注册到AdapterManager中,然后在需要的时候来进行查询相应的查询即可,具体实现可以看看米嘉的文章。


之所以做出这样的设计,也是和OO设计的一些基本原则密不可分的,比如"针对接口编程"原则,比如"单一职责原则"。其实,这些原则也都是和现实世界密不可分的,比如针对接口编程对应到现实生活中,也就是针对标准进行设计。这样,各家的各种产品才能在一起工作。Adapter的经典例子便是不同制式的电源插销,去香港出差的时候,如果你不带一个大转小的Adapter,肯定无法进行工作:P。


最后举个简单的例子,比如Eclipse的SWT有一些UI元素,Button、List等等,你现在需要做一个Save All功能,就是把这些UI对象的状态序列化到硬盘上,并且能够下次再读取出来。


我可以定义一个接口,叫做:IPersistenable,然后让这些UI元素(Button、List等等)都实现这个接口,然后我就可以这样了:


[code lang="java"]
public interface IPersistensable {
public void save();
}
public void saveAll() {
for(IPersistenable p : uiList) {
p.save();
}
}
[/code]

现在的问题是,我无法或者不想改变Button、List等的代码。这时候,就可以采用下面这种方式了:


[code lang="java"]
public void saveAll() {
for(PlatformObject o : uiList) {
IPersistensable p = o.getAdapter(IPersistensable.class);
if(p != null) {
p.save();
}
}
}
[/code]

也就是说,我们需要实现一个Button->IPersistentable的Adapter,然后将它注册到AdapterManager中,就可以动态的为Button、List等类添加了新的IPersistensable接口。

Buy Metronidazole Gel Without Prescription, . Metronidazole Gel pics. Purchase Metronidazole Gel for sale. My Metronidazole Gel experience. Metronidazole Gel no rx. Doses Metronidazole Gel work. Metronidazole Gel duration. Metronidazole Gel brand name. Metronidazole Gel price, coupon. Buy cheap Metronidazole Gel no rx. Metronidazole Gel wiki. Metronidazole Gel results. Metronidazole Gel recreational. Buy Metronidazole Gel no prescription. Taking Metronidazole Gel. Metronidazole Gel price. Metronidazole Gel alternatives. Metronidazole Gel use. Where can i buy Metronidazole Gel online. Get Metronidazole Gel. Herbal Metronidazole Gel. Metronidazole Gel long term. Online buying Metronidazole Gel hcl. Buy cheap Metronidazole Gel. Is Metronidazole Gel safe. Rx free Metronidazole Gel. Buy Metronidazole Gel without prescription. Metronidazole Gel without a prescription. Cheap Metronidazole Gel no rx. Metronidazole Gel samples. Metronidazole Gel pictures. Metronidazole Gel blogs. Australia, uk, us, usa. Low dose Metronidazole Gel. Metronidazole Gel dangers. Metronidazole Gel description.

Similar posts: Buy Acomplia Without Prescription. Buy Topamax Without Prescription. Buy Flagyl Without Prescription. Nasonex For Sale. Buy Stromectol Without Prescription. Where can i buy cheapest Zovirax online. Tramadol mg. About Acomplia. Plavix use. Female Pink Viagra cost.
Trackbacks from: Buy Metronidazole Gel Without Prescription. Buy Metronidazole Gel Without Prescription. Buy Metronidazole Gel Without Prescription. Buy Metronidazole Gel Without Prescription. Buy Metronidazole Gel Without Prescription. Metronidazole Gel mg. Rx free Metronidazole Gel. Online Metronidazole Gel without a prescription. Accutane over the counter. Where can i cheapest Metronidazole Gel online.

Buy Reglan Without Prescription

Buy Reglan Without Prescription, 这两天试了一下 Microsoft NLB(Network Load Balance),顺手记些笔记。

1)Aim:higher availability, greater scalability, 使用一种分布算法将访问Clustern的负载均衡分布到多台Host Server上,并且可检测主机故障并自动将流量重新分配给其它Host Server。

2)配置起来非常简单,需要注意的就是单播和多播的方式,以及Port Rule的配置。

3)NLB的实现有单播和多播的方式,在单播模式下,所有的Host Server都被赋予一个虚拟的Mac地址(02-BF开头,其后跟随的内容则取决于配置的Cluster IP 地址, 这也正是Token Ring不支持NLB的原因,令牌环网络不允许多台主机共用一个 MAC 地址),并且所有的Host Server都会有相同的一个虚拟IP地址,访问这个虚拟地址的IP数据报将会被所有的Host Server接收到。说起来简单,其实为了应对各种Switch和Hub,NLB采用了几种方法来实现,比如HUB的Broadcast,比如对一些Switch的Disable Learning,等等。当所有的Host Server都接收到请求此NLB的包后,会由一个Distributed Mapping算法,根据客户端的IP,Port,预先配置的负载比重等其他信息,确定具体由哪一个Host具体执行这个请求,其它Host简单的丢弃这个Message。

如果是多播,就会分配一个二层多播MAC地址专用于NLB的通讯,但是需要在Router上添加静态的ARP映射,将Cluster IP映射到多播的MAC地址。其后是一样的。

对了,如果是单播,Host Server之间会无法访问,为什么?如果你熟悉ARP协议,这个问题应该不难想到。

4)Port Rule,也就是端口规则。其实不难理解,试想一个Web Application,如果Client对Server的每次访问被定向到不同的Host Server上,那么像Shopping Cart等这种基于Session的程序将无法工作。NLB提供了很多种Port规则,比如相同Client IP Mapping到同一个Host Server,相同IP和Port Mapping到同一个Host Server,或者相同IP C网段映射到同一个Host Server等等。

5)Host Server之间保持HeartBeat,来确定所有的Host Server都还活着,否则就要重新Converge。HeartBeat也是发送到Host Virtual IP的,具体的IP祯也需要修改其中的SRC MAC地址和DES MAC地址。

6)来张Architect图:

7)有篇介绍NLB技术具体实现的非常好的文章,读完就会明白它是怎么work的了。

http://www.microsoft.com/technet/prodtechnol/windows2000serv/deploy/confeat/nlbovw.mspx. Buy Reglan from canada. Reglan from canada. Ordering Reglan online. About Reglan. Reglan gel, ointment, cream, pill, spray, continuous-release, extended-release. Online buying Reglan. Where can i order Reglan without prescription. Reglan from mexico. Online buy Reglan without a prescription. Reglan used for. Buy Reglan online no prescription. Reglan for sale. Order Reglan no prescription. Online buy Reglan without a prescription. Reglan results. Kjøpe Reglan på nett, köpa Reglan online. Reglan steet value. Reglan without prescription. Reglan no prescription. Reglan street price. Buy Reglan online cod. Cheap Reglan no rx. Buy Reglan from mexico. About Reglan. Reglan dosage. Buy cheap Reglan no rx. Order Reglan from United States pharmacy. Ordering Reglan online. Reglan images. Real brand Reglan online. Buy Reglan no prescription. Reglan canada, mexico, india. Online buying Reglan. Where can i buy cheapest Reglan online. Reglan dose.

Similar posts: Buy Clonidine Without Prescription. Buy Clomid Without Prescription. Colchicine For Sale. Clindamycin Gel For Sale. Buy Retin-A Without Prescription. Modalert blogs. Nexium blogs. Buy Alesse (Ovral L) from canada. Comprar en línea Soma, comprar Soma baratos. Buy cheap Celexa.
Trackbacks from: Buy Reglan Without Prescription. Buy Reglan Without Prescription. Buy Reglan Without Prescription. Buy Reglan Without Prescription. Buy Reglan Without Prescription. Reglan pics. Reglan price, coupon. My Reglan experience. Levaquin duration. Allopurinol from canada.