G
Guillermo Schwarz
C++ers,
I have programmed in C++ since 1991 and I probably created my best
abstraction layers in C++ in those days. Since 2001 I've been
programming in Java (at first against my will, then I realized the
market was moving into Java) and I'm trying to reimplement in Java
what I did back in those days.
The problem I have is that I have a job offer for programming in C++,
again!!!, and I don't know if I should take it. My problem is mainly
that I use to program using Dynamic proxies in Java, and the mere idea
of going back in time on that technology makes me feel very uneasy and
worrying that I will spend many years writing code that could be
written in months.
In short, is there a mechanism in C++ that is similar to the Dynamic
Proxy mechanism?
If you don't know what a dynamic proxy is, it is simply an interceptor
class that performs some code before and after any method of the
intercepted class, given by the interceptor class. The dynamic proxy
is like a normal proxy, except that a normal proxy must be rewritten
for each intercepted class, while the dynamic proxy is written pnly
once and reused for all intercepted classes.
http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html
It can be used for logging, for returning resources (like
connections), for validating inputs, for converting normal classes
into EJBs (so remoting them and making them implicitly transactional),
etc.
Cheers,
Guillermo.
I have programmed in C++ since 1991 and I probably created my best
abstraction layers in C++ in those days. Since 2001 I've been
programming in Java (at first against my will, then I realized the
market was moving into Java) and I'm trying to reimplement in Java
what I did back in those days.
The problem I have is that I have a job offer for programming in C++,
again!!!, and I don't know if I should take it. My problem is mainly
that I use to program using Dynamic proxies in Java, and the mere idea
of going back in time on that technology makes me feel very uneasy and
worrying that I will spend many years writing code that could be
written in months.
In short, is there a mechanism in C++ that is similar to the Dynamic
Proxy mechanism?
If you don't know what a dynamic proxy is, it is simply an interceptor
class that performs some code before and after any method of the
intercepted class, given by the interceptor class. The dynamic proxy
is like a normal proxy, except that a normal proxy must be rewritten
for each intercepted class, while the dynamic proxy is written pnly
once and reused for all intercepted classes.
http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html
It can be used for logging, for returning resources (like
connections), for validating inputs, for converting normal classes
into EJBs (so remoting them and making them implicitly transactional),
etc.
Cheers,
Guillermo.