Was denn für Codefragmente?
Ich kann mir folgende Lösung vorstellen:
Delphi-Quellcode:
type
TFoo = class
private
FMyUnknownObject: IUnknownObject;
...
Delphi-Quellcode:
function TFoo.GetMyUnknownObject: IUnknownObject;
begin
if not Assigned(FMyUnknownObject) then
FMyUnknownObject := TMyUnknownObject.Create;
Result := FMyUnknownObject;
end;