简单分析TXMLDocument内部结构[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 testnet 的 blog

abstract factory希望不用指定具体的类,但为了找到它们,在txmldocument是通过指定一个字符串,也就是我们点击domvendor时出现的哪几个字符串.现在回到开始,再来看看切入点

domvendor := getdomvendor(domvendordesc);

最后取得一个idomimplementation,它有一个createdocument….:idomdocument;函数,这个函数将返回一个idomdocument;接口让ixmldoucment使用。

在如果使用msxml,接口对应的是tmsdomdocumenttmsdomdocument是实际上是调用msxml技术,下面是调用ms com的代码

function createdomdocument: ixmldomdocument;

begin

  result := tryobjectcreate([class_domdocument40, class_domdocument30,

    class_domdocument26, msxml.class_domdocument]) as ixmldomdocument;

  if not assigned(result) then

    raise domexception.create(smsdomnotinstalled);

end;

本文关键:TXMLDocument,设计模式
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top