G
gatescope
In C++ minimizing Compile Time dependencies is a fundamental physical
design issue. The class designer tries to create as minimal
dependencies to other classes using forward declarations and
eliminating as many include directives he can, usually implementing the
class details using an envelope - letter (pimpl) pattern.
Is a similar approach doable in Java ?
Please note that there are three types of changes :
1) Adding new methods
2) Modifying the body of a method
3) Modifying the signature of an existing method
For cases 1 and 2 compiling the class does not break existing clients
of it (my understanding is that the VM is using Reflection to map
method calls), which is fine.
BUT case 3 causes callers of the method to throw a RUNTIME exception.
The only way around it is to recompile the client class.
If we use timestamp comparison to recompile we are going to end up
recompiling even for cases 1 and 2.
I don't know if the only way around it, is for the developer to
enforce a coding rule not to modify the signature of a class unless he
is willing to recompile his entire application.....
Any help will be greatly appreciated
Thanks
John
design issue. The class designer tries to create as minimal
dependencies to other classes using forward declarations and
eliminating as many include directives he can, usually implementing the
class details using an envelope - letter (pimpl) pattern.
Is a similar approach doable in Java ?
Please note that there are three types of changes :
1) Adding new methods
2) Modifying the body of a method
3) Modifying the signature of an existing method
For cases 1 and 2 compiling the class does not break existing clients
of it (my understanding is that the VM is using Reflection to map
method calls), which is fine.
BUT case 3 causes callers of the method to throw a RUNTIME exception.
The only way around it is to recompile the client class.
If we use timestamp comparison to recompile we are going to end up
recompiling even for cases 1 and 2.
I don't know if the only way around it, is for the developer to
enforce a coding rule not to modify the signature of a class unless he
is willing to recompile his entire application.....
Any help will be greatly appreciated
Thanks
John