I have the following interface:
type IDataAccessObject<Pk; T:class> = interface getByPrimaryKey(key: PK) : T;
And the interface implementation is as follows:
type TMyClassDAO = class(TInterfacedObject, IDataAccessObject<integer, TMyClass>) getByPrimaryKey(key:integer) : TMyClass; // more methods end;
Note that I am not providing a guid for the interface (since each instantiation of the previous common interface represents a different interface, and they should not use the same guid ). However, I'm not sure if this does not break the reference count implemented by TInterfacedObject ?
source share