<div dir="ltr"><div class="gmail_quote">On Wed, Jun 20, 2012 at 10:20 AM, <span dir="ltr"><<a href="mailto:michael.vancanneyt@wisa.be" target="_blank">michael.vancanneyt@wisa.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
On Wed, 20 Jun 2012, ik wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Wed, Jun 20, 2012 at 8:33 AM, LacaK <<a href="mailto:lacak@zoznam.sk" target="_blank">lacak@zoznam.sk</a>> wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
**<div class="im"><br>
Class helpers would not help ?<br>
<br>
<a href="http://wiki.freepascal.org/Helper_types" target="_blank">http://wiki.freepascal.org/<u></u>Helper_types</a><br>
<br>
</div></blockquote><div class="im">
<br>
<br>
They can, but there is a protocol that I'm trying to create that provides<br>
me information what to execute (out of white list). The thing is, that the<br>
first request maps the methods to be used, and there could be 2 or 200. To<br>
implement 200 methods that might be used is not a good idea imho, but<br>
adding the proper method to the instance/class will work much better.<br>
</div></blockquote>
<br>
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<br>
far as I can see, or is made easier by dynamically adding methods.<br>
<br>
So finally, what is gained by adding them dynamically ? Or what forces you to even consider this path ?<br></blockquote><div><br>Think of a plug-able system. I have an engine, and code to execute. Instead of compile everything to an ELF/PE, I place code on dynamic shard library, and load it on run time when needed.<br>
<br>The idea is that the engine will not be rewritten for every new request (that comes often), because it's logic (almost) never changes, but to load code on demand that often changes, provide additional functions, changes of logic, bug fixes etc... <br>
<br>The idea of implementing it like so, came to me after few years now of having the need to recreate the whole logic based of the code for every new demand from the client (both as human, and as software). The main code almost never changes, but so many additions, that I'm starting to use the dynamic execution of methods, and now I realize, that if I'll extract it to a shard library, it will be much easier to change, add etc... only the actual need, and not to touch other stuff, and that requires me to design an engine instead.<br>
<br>Regardless of that idea, it can be very interesting in learning how to do it imho :)<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Michael</blockquote><div><br>Ido <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.<u></u>org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/<u></u>mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br></div>