[jboss-dev] How do you split your classes?

Sacha Labourey sacha.labourey at jboss.com
Thu Sep 4 05:47:02 EDT 2008


Team,

I am interesting in better understanding how you take decisions when
splitting classes between JARs. Let me be more accurate...

Ideally, each macro-service (Tomcat, WS, EJB3, etc.) would have its own
MyService.sar file/directory in /deploy (or better, /deploy/system/). This
SAR would contain all required implementation classes, services definition,
etc. and would also list its dependencies in one of its jboss-services.xml
<depends> tags. Then, if for some reasons this service needed to share some
API classes with other services AND it was using some separate unified
classloader, it could "pollute" the AS at large by putting these classes in
the /lib folder of the AS. The outcome of this is that it would be very easy
to remove a service: simply drop its folder from /deploy and that's it
(modulo the potential pollution taking place in /lib).

Now, we all know this is NOT how it happens in real-life. Hence, my
question: WHY? What leads you to do things differently? I'd like to
understand it better so we can potentially improve things.

It is worth mentioning that this is the pre-AS5 situation. With AS5 and its
new classloaders à la OSGI, it is going to be possible to put EVERYTHING in
specific directories in /deploy thanks to the import/export features Adrian
has implemented. Consequently, outside of core services (specific deployers
or any bootstrap code à la VFS, etc.), no JAR should be needed in /lib.

Thanks for your feedback. Cheers,



sacha





More information about the jboss-development mailing list