在公用单元中按公用函数的类型封装到各个[类]对象中,然后创建
这些方法对象的实例。然后通过实例来调用对应方法。
这样对集体开发及代码管理都很有益处:
unit UnitGMethod
interface
uses
.................
type
TMUMethods = Class
(*常用功能类*)
public
procedure ...........
function ...........
end;
TMUTreeMethods = Class
(*树操作方法类*)
public
end;
TMURichEditMethods = Class
(*编辑框方法类*)
Public
end;
.................
end.
unit unitRunSystem
.................
Var
MUMethod : TMUMethods ;
MUTreeMethods : TMUTreeMethods;
MUREditMethods : TMURichEditMethods;
.....................
create & destroy
end.