Board index » delphi » Tricky Question about howking constructors
Hechicero
![]() Delphi Developer |
Tricky Question about howking constructors2005-02-10 12:28:42 AM delphi164 Hi, I've been giving the following idea some thought but I'd really appreciate your insights. I coded an OPF. Instead of objects the programmers uses proxys that contains the real subject. To create a new object inside the framework (and persistent) you use a Factory. Something like this: var aClient : TClient Begin aClient := HecFactory.CreateNewClient; .. Here a Client actually references a ClientProxy but that is supposed to be "transparent" to the programmer. The thing is like this. I managed to hook the constructor using some libraries that modifies the assembler in memory or something. Using those libraries I can make something like: Client := TClient.Create; But when you see the client Classname it result that it is actualy a proxy. In that way the creation if even more transparent. You can add a unit to your project have persistent objects and comment that unit and the code would still work. I tested troughtly and it worked perfectly but...The ting is. To do that you hace to modify de ASM in memory with this libraries. I have to decide if I hace to implement it or leave the factory as it is. What is your advice. The procedure to do it is very strange so I cannot make my mind. I hope I explained my point. If I missed something or if there is some detail missing please ask. What is your advice? Esteban Calabria |