On Wed, 20 Jun 2012, ik wrote:

On Wed, Jun 20, 2012 at 8:33 AM, LacaK <la...@zoznam.sk> wrote:

**
Class helpers would not help ?

http://wiki.freepascal.org/Helper_types



They can, but there is a protocol that I'm trying to create that provides
me information what to execute (out of white list). The thing is, that the
first request maps the methods to be used, and there could be 2 or 200. To
implement 200 methods that might be used is not a good idea imho, but
adding the proper method to the instance/class will work much better.

I don't understand this argument. The available methods must have an implementation somewhere anyway. That means your code does not get smaller by adding them dynamically. Somewhere you must choose which method to execute, and whether it is allowed or not, so this logic must be present also. None of this requires dynamically adding methods as
far as I can see, or is made easier by dynamically adding methods.

So finally, what is gained by adding them dynamically ? Or what forces you to even consider this path ?

Michael
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to