Minimizing Compile Time Dependencies

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
 
C

Chris Smith

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.....

Language-aware incremental build tools, such as the compiler in Eclipse,
are capable of dealing with this and doing incremental builds.
Otherwise, yes you rebuild the entire application.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top