ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claas Thiele <cthi...@ct42.de>
Subject Re: Best Practices ANT
Date Sat, 21 Feb 2004 19:19:59 GMT
Keith Hatton wrote:
> <snip>
> I recall that EJBs are supposed to be in individual JAR files, so I think that combining
them into a single JAR file would be classified as a Bad Thing(tm).
> </snip>
> 
> I don't think it's a Bad Thing, otherwise the deployment descriptor wouldn't allow for
it :)
> It's fair enough to package related EJBs together.
> 
> It's also fair enough (getting back to the original point of the thread) to have the
WAR file build depend on the EJB build - particularly, for example, if the servlets or JSPs
make calls to those EJBs. And building an EAR file depends on both those tasks. Obviously
having the dependencies the other way round would not make sense.
> 
> Keith
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
One jar per EJB?
In some cases EJBs must reside in the same jar: using local interfaces 
(for instance needed for CMR).



The intension of J2EE is building components (combinations of EJBs are 
components too) and having the freedom to replace these components by 
another implementation or combine them to another app as mentioned in 
this thread before.

This can work while the components are independent as possible. This is 
true for the buildsystem too. Why build a component and using another 
instead of the built one? Or: why build the whole project for using one 
component of this project in another project?

The rule should be: find replaceable and reusable components and build 
them separatly.

What is needed building a dependent component (i.e. a war dependent of a 
ejb-jar) are the interfaces (home, remote, local). So it is a good idea 
separating this things too.
This interfaces are important for developers of replacable components: 
they have rely on this (it is the contract they have to fulfill, 
together with some other things)

For testing remote components the stubs are needed too. Most servers 
supports this by building a client.jar for the server side components. 
Thats vendor dependent. Using a dynamic proxy architecture (like JBoss) 
one client.jar for all apps are enough.

Conclusion: Build a inseparable bunch of EJBs as an independent project, 
deliver interfaces and other things forming a contract like docs and 
tests to the users and developers of these things (maybe yourself in 
your webapp).

Maybe I forgot something to be put in the components build...


Claas

P.S. Using J2EE without thinking about separation of reusable components 
sooner or later it is seen as a big overkill with all of this crazy 
stuff like the bunch of interfaces and descriptors.

-- 
____________________________________________________________________
Dipl.-Inf. Claas Thiele          	EMail: cthiele<at>ct42.de
Konradstr. 58                    	Web:   http://ct42.de
04315 Leipzig                    	Tel.: +49 (0)341 68 70 92 29
GERMANY                          	Fax   +49 (0)341 68 70 92 30



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message