Quick Question about TInterfacedObject:
Quick Question about TInterfacedObject:
if I subclass TInterfacedObject is it necessary to include an interface or it is implicitly assumed the IInterface?
So, are these two the same:
TmyClass = class (TInterfacedObject)
and
TmyClass = class (TInterfacedObject, IInterface)
Thanks
if I subclass TInterfacedObject is it necessary to include an interface or it is implicitly assumed the IInterface?
So, are these two the same:
TmyClass = class (TInterfacedObject)
and
TmyClass = class (TInterfacedObject, IInterface)
Thanks
So, basically if we inherit every class from TInterfaced we introduce automatic life management
ReplyDeleteBut IInterface doesn't give you access to any properties or methods in the class, right?
ReplyDeleteJohn Kouraklis No, that was because I used an example that didn't bother with lifetime, to reduce the size of the code, and so focus on the main point.
ReplyDeleteThe whole point of TInterfacedObject is to have the interface reference count manage the lifetime of the implementing object. That's why it exists.
What is behind the question.