Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

Separate compilation of interfaces and implementations?

Thread view: 
Dan Stromberg - 03 Jan 2008 01:03 GMT
I'm doing some work on a large software project that has mutual
dependencies - EG, the build of jar A depends on jar B's interface, and
the build  of jar B depends on jar A's interface.

It seems these dependencies could be resolved nicely if we were to build
the interface of A, then the interface of B, then the implementation of
A, then the implementation of B - just for example.  Or more generally,
just go through and build all the interfaces first, then go back and
build all the implementations.

Does java support this sort of thing?  I'm not expecting java to invoke
the compiler for me, but I am hoping that java will allow taking a bunch
of .java's, and produce two jars for them - one for public interfaces and
one for the private interfaces and implemtations.

Thanks!
External Concepts Guild - 03 Jan 2008 13:52 GMT
> I'm doing some work on a large software project that has mutual
> dependencies - EG, the build of jar A depends on jar B's interface, and
[quoted text clipped - 12 lines]
>
> Thanks!

It is  not good practice to have such mutual dependencies.
A simple solution would be to simply place the public
interfaces in a separate directory from the private
interfaces and implementations.  Remember to compile and jar
the public interfaces first.  After you have compiled and
jarred the public interfaces, then you can (with appropriate
classpath additions) compile and jar the private interfaces
and implementations.

Emory Merryman
External Concepts Guild
Mike Schilling - 03 Jan 2008 14:33 GMT
> It is  not good practice to have such mutual dependencies.
> A simple solution would be to simply place the public
[quoted text clipped - 4 lines]
> classpath additions) compile and jar the private interfaces
> and implementations.

Even better, place the public interfaces (and anything else you want
to go into the lower-level jar) in a separate source tree. That makes
it much harder for wrong-way dependencies to creep into the code.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.