易截截图软件、单文件、免安装、纯绿色、仅160KB

Using COM+ object pooling with Delphi 6

 URL: http://edn.embarcadero.com/article/27568
Abstract: Delphi 6 introduces support for COM+ object pooling, which can provide significant performance improvements under some circumstances. We take a look at Delphi 6s object pooling support. By Vincent Parrett.
Typically, when a client application instantiates a COM+ object, the COM+ runtime will create a new instance of the object. When your client is done with the object, COM+ will destroy the object. This all makes for very efficient use of memory resources, and under normal loads provides quite an acceptable performance.
However, under higher loads the creation and destruction of objects can become a substantial overhead. This is especially true if your COM+ objects are themselves allocating resources, instantiating other objects, and so on.
Object pooling can help in these situations by reducing the number of times an object must be instantiated or destroyed. When pooling is in effect, a client's request for an object will kick of a search to see if there is a ready-to-use object pool for objects of the appropriate type. If so, the COM+ system will provide and activate the object. If not, COM+ will create a new object. When the client is done with the object, COM+ will not destroy the object, but will return it to the object pool so it can be reused.
To get the best out of COM+, your objects should be stateless. To make use of object pooling, they must be stateless objects.
Object pooling with Delphi 6
Supporting object pooling in Delphi 6-generated COM+ objects is simple, however there are a few things that you need to take care with:
Threading model
The first is that you must select the Both threading model, otherwise object pooling will be disabled.
If you get this wrong, don't worry -- it's easy to fix. The New Transactional Object wizard generates code that looks something like this :
initialization
TAutoObjectFactory.Create(ComServer, TMyCOMPlusObject, Class_MyCOMPlusObject,
ci


相关文档:

Delphi 设计模式:《HeadFirst设计模式》Delphi7代码

命令模式可以很轻松的实现撤销(Undo)功能。
1. 命令的接受者
unit uReceiveObject;

interface

type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;

implementation

{ TLight }

procedure TLight.Off;
begin
Writeln('Light is off.'); ......

DB2 和 Delphi 7 — SOAP 和数据库 Web 服务

 构建 Windows SOAP 服务器应用程序
首先在 Windows 上构建服务器,然后在 Linux 上构建客户机。(如果需要,可以使用其它方法 — 或者将它们全部构建在 Windows 或 Linux 上。)对于 Windows SOAP 服务器,启动 Delphi 7 Enterprise,执行 File -> New -> Other,转至对象资源库(Object Repository)的 ......

Delphi源码免杀定位MAP的方法

 Delphi的源码定位方法网上搜索到好像不太多。
这里分享我自己的两个方法。
引用一段话
 引用内容
什么是 MAP 文件?
MAP 文件是程序的全局符号、源文件和代码行号信息的唯一的文本表示方法,它可以在任何地方、任何时候使用,不需要有额外的程序进行支持。而且,这是唯一能找出程序崩溃的地方的救星。
DEL ......

在Delphi中使用RAS实现对系统拨号的控制

 在Delphi中使用RAS实现对系统拨号的控制
  在企业应用中有时候希望能在程序中实现对拨号网络的控制,以实现自动拨号、自动断开网络。在尝试了多种方式之后,认为RAS是一种比较稳定的方式。在google了网上一些资料后,现整理如下:
一、首先需要有个针对RAS的头文件定义,Ras.pas代码如下
 
{* Cop ......

Delphi下生成Map文件方法,免杀或调试用的

 以前看了 通过崩溃地址找错误行数之VC版 那时候还没用DELPHI
昨晚刚好又看到了 所以就试了一下DELPHI的,与大家共享 ^_^
什么是 MAP 文件?简单地讲, MAP 文件是程序的全局符号、源文件和代码行号信息的唯一的文本表示方法,它可以在任何地方、任何时候使用,不需要有额外的程序进行支持。而且,这是唯一能找出程 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号