When Delphi constructor likely to fail
How to deal with this problem?
1. constructor Create(var Success: Boolean);
The client will see the parameter obviously.
2. raise exception
The client must be told to use try...except to catch the exception.
3. Destroy; Self := nil;
The client must validate the object it wants to create.
1. constructor Create(var Success: Boolean);
The client will see the parameter obviously.
2. raise exception
The client must be told to use try...except to catch the exception.
3. Destroy; Self := nil;
The client must validate the object it wants to create.

0 条评论:
发表评论
指向此帖子的链接:
创建链接
<< 主页