[fpc-devel] Considerations about observer [was: Free Pascal 2.6.2 rc1]

Graeme Geldenhuys graeme at geldenhuys.co.uk
Wed Nov 28 11:22:23 CET 2012


On 2012-11-28 10:07, Graeme Geldenhuys wrote:
> 
> You can add a CORBA interface to any existing class, and it doesn't need
> to descend from TInterfacedObject either. CORBA is not COM interfaces.
> 

In case anybody is in doubt. Here is a small example where CORBA
interfaces are attached to TComponent (aka TInterfacedObject
descendants) and TObject classes.

With CORBA interfaces - unlike COM interfaces - we can extend *any*
class. A lot more useful!



----8<-------------8<-------------8<-------------8<-------------8<----
MyShape was created
MyShape is being freed
----------------
MyShape was created
AttachObserver called - MyShape
MyShape is being freed
----------------
MyNonInterfacedObjectClass was created
AttachObserver called - MyNonInterfacedObjectClass
MyNonInterfacedObjectClass is being freed
----------------
----8<-------------8<-------------8<-------------8<-------------8<----


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pas
Type: text/x-pascal
Size: 2267 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20121128/ffa0d006/attachment.pas>


More information about the fpc-devel mailing list