Marco Tedone wrote:
The jars created at the end contains only the Manifest.mf and the Sample.class file
Tha't correct - because its only a template - you would notmally throw away the Sample.java and put in place you own sources. They are only there to validate that the build is working, that unit tests using merlin are running, and that the site generate is correctly aggregating content.
Cheers, Steve.
Am I correct if I say that under api one should write the interfaces/exceptions, while under impl one should write the actual classes?
Yes.
If so, in a real project, shouldn't the jar include both the
interfaces/exceptions and implementation classes?
No.
If so, I imagine at a certain point I would have something:
/api /target Interface1.class Interface2.class Exception1.class Exception2.class ... /impl /target Interface1_Impl.class Interface2_Impl.class ...
All of this should be grouped in an armonic jar (i.e. template-1.0.jar).
No!
You want to keep these seperate. If someone is using you service - they only need to include your API into their classloader. Typically the API will have no dependencies - or at least only dependecies on other service APIs. Most importantly they do not and should not be including your implementation classes into their classloader. The think is that is a user of you component is focred to include implementation classes into their classloader - this means including all of the dependencies of the implementation as well. This then forces the user to make sure that their own classes don't clonfict with your implementation (e.g. different version of a package). If you keep things seperate - then the only dependency that the consumer is concerned about is the service API - merlin takes care of the rest by establishing a seperate classloader for you implementation.
Cheers, Steve.
How could I obtain this result? How could I tell the build process to compile both the classes under api and impl and to build a jar from the two different /target folders?
Marco
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Stephen J. McConnell mailto:[EMAIL PROTECTED]
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/ | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
