ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chappell, Simon P" <Simon.Chapp...@landsend.com>
Subject RE: Best Practices ANT
Date Thu, 19 Feb 2004 15:08:01 GMT


>-----Original Message-----
>From: priya pallavi [mailto:pry_pallavi@yahoo.com]
>Sent: Thursday, February 19, 2004 8:47 AM
>To: user@ant.apache.org
>Subject: Best Practices ANT
>
>
>Hi friends,
> 
>Iam new to J2EE archtecture and ANT.When iam trying to create 

Welcome to the joys of solid repeatable builds (ant) and bewildering configuration files (J2EE)
:-)

>.jar and .war files to create .ear file , iam facing many 
>problems while compiling classes in webmodule and ejbmodules 
>(one is dependent on other) due to dependencies on each 
>other.I would like to know what is the best practice in J2EE 
>archtecture ?/

<cynical>Best practice is an industry buzz word for "what others say that they do".</cynical>

>1)Is it Good to make sure that both EJBModule and WebModule 
>independent so that creating .jar and .war will become easy??

Yes. Especially when you remember the formula that:

EAR file = WAR file(s) + EJB JAR file(s)

So make all your EJBs and ensure that they are in appropriate JAR files. Then bring the pre-built
EJBs into your web project and make the WAR file. Then create the EAR file containing both
the WAR file(s) and EJB JAR file(s).

>2)What we need to do If we can't make then independent?

That's a very good indicator that you need to refactor or re-engineer.

>3)Is it good to have independent build.xml for each module?

My rule of thumb is a build file per independent entity. So, EJB's that you plan to reuse
would be best setup as independent projects, with their own build files. Then any project
that needed them could use the pre-built EJBs and also have it's own build file.

>4)If we are using independent build.xml for each module how to 
>call one build.xml from other?

I suggest that you not do that. It's better to bring in a bre-built EJB from another project
than to build it upon demand. This gives you a much lower coupling, allowing you to swap out
the EJB with another one that implements the required API. It also removes any chance that
the EJB might be unbuildable at that instant (build breaks do happen in the real world).

>Please advice me.

Bestowing my opinions upon others is what I do best. :-)

>Thanks

Your welcome.

>Priya 

Simon

-----------------------------------------------------------------
Simon P. Chappell                     simon.chappell@landsend.com
Java Programming Specialist                      www.landsend.com
Lands' End, Inc.                                   (608) 935-4526

"Wisdom is not the prerogative of the academics." - Peter Chappell

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


Mime
View raw message