It is pretty useful, in some cases, to retrieve a class
instance from a given interface.
You should better use
interfaces in your business logic, but having access to the underlying
implementation is needed at lower level.
Beginning with Delphi 2010, you are able to use the as
operator, e.g. via aObject := aInterface as TObject or
aObject := TObject(aInterface).
This operator use a special hidden interface GUID (ObjCastGUID) to
retrieve the object instance, calling an enhanced version
of TObject.GetInterface.
But if you want to maintain compatibility with older version of Delphi (as we want for mORMot to work with the beloved Delphi 6 or 7), you'll have to find a way.
