Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

ID: 28287, Demo of dynamic support interface.

by Roman Silin Email: Anonymous

This demonstration of dynamic support interface.
One variable can support several interfaces...
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 2.0  to 14.0 126 downloads
Copyright: No significant restrictions

Size: 7,105 bytes
Updated on Tue, 11 Oct 2011 05:33:26 GMT
Originally uploaded on Thu, 14 Apr 2011 00:56:50 GMT
SHA1 Hash: 25AD5E6380698F622B6CA421D3C8CE0AC3FA2B0D
MD5 Hash: 2EA7392A06E677D044DEB3BEB94B72E1

    Explore the files in this upload

This demonstration of dynamic support interface.
One variable can support several interfaces. For example:

if Supports(MainIntf, IIntf1, Intf1) then,
if Supports(MainIntf, IIntf2, Intf2) then…

That this was possible, there is first way. Support is defined in declarations of the class:

TMainIntf = class(TInterfacedObject, IIntf1, IIntf2… IIntf1000)…

This is a sad way. For each project we have its list of the units, its list interface in declarations of the class and its realization of support. To disconnect any one of interface us it is necessary: delete it from declaration, delete the code of support and delete the module from list.

There is second way. Dynamic support is created for lazy people specially. To add support it is necessary only to add the unit in project. There is following code in unit:


Accordingly to take away support it is necessary to take away the module. I have a necessary result, nothing not making in addition. And always can realize the first way, when this will be necessary. I even can use both ways simultaneously. But the main advantage - possible use in program any outside GNU libraries, connect and disconnect them anytime. And herewith main code of the program nothing do not be aware of these library. For instance, there is internal version of the program, which is used inwardly my company and there is version of the program on sale. The Internal program will die to show stack errors. But differ they only that that is added by 1 module. All outside components are insulated.

One more plus - that easy to realize the mode limited functional. The Program can dynamically disconnect support an interface inaccessible in trial version. With standpoint of the development, nothing not it is necessary to think up.

Roman Silin (aka Romario).

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03