I would have wanted it to be more like "hooking". Hooking usually means
that there's an interface for what you can hook and what the hooked
objects can do etc, as well as the encapsulation borders of the hooked
object and the hook object being retained.

Having given it some extra thought, putting code in the start of a
function isn't really an issue at all, it's just putting code at the end
which opens up possibilities for mayhem. Two things come to mind: 1)
what happens with the return value of the target function, and 2) if the
code being inserted relies on the implementation (variables etc) of the
target function, things will eventually blow up. Naturally, this is only
an issue if you allow random use of the addCode method to insert code in
the end of methods, which I assume isn't gonna happen anyway.

Basically, my instincts just flared slightly at the thought of letting
something like this loose in a developer community without any comment
on the use of it. It's a very nifty tool if you know what you're doing,
that's for sure. So as long as you made sure everyone who might use the
method knew what they were doing, for example by commenting the method
and explaining what you shouldn't do, it's not really anything to worry
about.

Besides, I totally realise that dynapix is a project just having started
up, and know well enough that you wouldn't have had the time to consider
every single aspect of every piece of code in it as of yet. I think
dynapix looks great and I think you've done a great job of making an
improved API. In the end, it's what actually gets done that matters, not
what people say.


After some tweaking and scanning through dynapi-help archives (thank you
mail-archive.com), 
I've actually managed to get CVS working on my machine, so I'm going to
start devoting effort to the destroy/memory release problem now, just to
add to the total effort of fixing it.


Anyway, keep up the good work.


Cheers,

Daniel


Pascal wrote:
> 
> > Having given this a few minutes of thought, this is something which
> > scares me. Having the possibility of your function being
> > modified by any
> > other package or extension is a horrible thought, because it means you
> > have no way of telling in what ways your function might change
> > dynamically during loadup.
> 
> Look at it more like "hooking"
> You cant delete the original method code (you can, but you have always been
> able to do that by simple rewriting the method)
> 
> you'r just hooking your own code into the method call.. with added
> functionality of adding it to the beginning (onbefore) or at the end
> (onafter).
> 
> Changing of methods has always been available, people could have rewritten
> dynlayer methods for there own use.. now we're just giving another way of
> doing it so that the API code itself can extend itself (real dynamic html :)
> 
> This is just very flexible stuff, and even though it's not normal usage it
> does open up a few nice implementations.


--
Daniel Aborg  <[EMAIL PROTECTED]> 
T: 0207 445 447  M: 07720 29 44 40

_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev

Reply via email to