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 / December 2007

Tip: Looking for answers? Try searching our database.

configuration management application

Thread view: 
gmannelli@gmail.com - 19 Dec 2007 13:37 GMT
Hello All!
Anybody of you knows if there is any application (free or not) to
manage the development of java applications for different evnironment?
To better explain:
suppose you develop a very simple application:
2 java file
2 image
2 template document
1 property file whit 1 key

Suppose you have 2 customer for that application. Eache one of that
has his configuration comosed by:
1 of the two java files
1 of the two imagees
1 of the two template document
the proprty file with his own value for the key.

The software that I am looking for has the ability to let you develop
the enteir project (all .java, all the images, all the template files
etc) and give you the opportunity to create patch for each customer
choosing for you the right customization.

I hope I explained myself...
Mark Space - 19 Dec 2007 15:47 GMT
> Hello All!
> Anybody of you knows if there is any application (free or not) to
[quoted text clipped - 5 lines]
> 2 template document
> 1 property file whit 1 key

This seems very simple to me.  Almost anything could be used for this.
You might want to (re)familiarize yourself with the Java command line
tools.  The simplest would be to just use jar and ant to build targets.

http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html

http://ant.apache.org/

If you've been developing Java programs you should already have all of
these tools on your hard disc.

Property files are just text files, their format can be found here:

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load(java.io.I
nputStream
)
gmannelli@gmail.com - 20 Dec 2007 10:31 GMT
> gmanne...@gmail.com wrote:
> > Hello All!
[quoted text clipped - 10 lines]
> You might want to (re)familiarize yourself with the Java command line
> tools.  The simplest would be to just use jar and ant to build targets.

Thanks for your reply but...

Question number 1, can ant manage file different from source file, can
it copy (for instance) differente image file for each target?

Question number 2, can ant create something like a patch or it make a
whole new jar each time?

Qustion number 3, you should change the build.xml file each time you
add or remove a file to your application?

Question number 4, can ant manage different key value in same
properties file for different targets? In other word somethinglike put
the suitable connection string in the conf.properties file for each
env?

Thx, in advantage for you answer and excuse mefor my poor english
Lew - 20 Dec 2007 14:02 GMT
> Question number 1, can ant [sic] manage file different from source file, can
> it copy (for instance) differente image file for each target?
>
> Question number 2, can ant create something like a patch or it make a
> whole new jar each time?

The usual mode is to create a new JAR for a new build.  That is not an Ant
issue, that's a Java issue.  You could make Ant do some kind of patch-like
build using custom code, if it's something you feel you really, really,
absolutely must do, but it's likely easier not to, and likely much more
satisfying for deployers and users alike.  Again, this isn't an Ant issue but
a JAR issue.  My best advice is not to do that, but use JARs the ordinary way.

> Qustion number 3, you should change the build.xml file each time you
> add or remove a file to your application?

Not usually.  The canonical build.xml for a standard project source layout
would need no changes whatsoever.  It is possible to construct your build file
so that it is required to change it with changes to your application, should
you so desire.

> Question number 4, can ant manage different key value in same
> properties file for different targets? In other word somethinglike put
> the suitable connection string in the conf.properties file for each
> env?

Ant /could/ be set up to modify the properties file, but it isn't really set
up to be an editor.  Much easier is to use Ant to /select/ the appropriate
configuration for a build.  However, it is also rather unusual to create a
different build for different environments.  That is usually a deployment
issue, not a build issue.

One of Java's strengths is that you can deploy the same artifact without
modification to multiple targets.  You could defeat that by creating separate
builds, but should you?

Did you take any time at all to view the Ant documentation?
<http://ant.apache.org/>
<http://en.wikibooks.org/wiki/Programming:Apache_Ant>

Signature

Lew

Lew - 20 Dec 2007 14:03 GMT
gmannelli@gmail.com wrote:
>> Question number 1, can ant [sic] manage file different from source
>> file, can
>> it copy (for instance) differente image file for each target?

Yes.

Signature

Lew

gmannelli@gmail.com - 21 Dec 2007 09:57 GMT
> gmanne...@gmail.com wrote:
> > Question number 1, can ant [sic] manage file different from source file, can
[quoted text clipped - 32 lines]
> modification to multiple targets.  You could defeat that by creating separate
> builds, but should you?

First of all thanks for your replay. I agree with you but you are
talking about "developing best practces" after all. My original
question was different, there is an application that take help you
manteinig different installation of a general java application (not
necessary too much well designed) ?

> Did you take any time at all to view the Ant documentation?
> <http://ant.apache.org/>
> <http://en.wikibooks.org/wiki/Programming:Apache_Ant>

I'll do I promise... as soon as possibile
Michael Redlich - 19 Dec 2007 16:56 GMT
> The software that I am looking for has the ability to let you develop
> the enteir project (all .java, all the images, all the template files
> etc) and give you the opportunity to create patch for each customer
> choosing for you the right customization.
>
> I hope I explained myself...

As Mark has already mentioned, Ant (http://ant.apache.org/) is a great
build tool.  You may also want to consider Maven (http://
maven.apache.org/).

Hope this helps...

Mike.

---
ACGNJ Java Users Group
http://www.javasig.org/ (best viewed in Firefox and Safari)
arimanni@gmail.com - 20 Dec 2007 08:20 GMT
I don't know enough about config management tools to suggest any but I
would use Apache Ant for this sort of stuff.

Since this sounds like quite typical Java development, I would use
Eclipse (see www.eclipse.org) for development. Then I would create a
build.xml to build application / installation package. Depending more
specific needs (project complexity, number of environments), I would
either create separate targets in this build.xml or configure it with
parameters.

If the project would be more complex, I would consider using a version
control system and storing separate branches for different
environments.

On 19 joulu, 15:37, gmanne...@gmail.com wrote:
> Hello All!
> Anybody of you knows if there is any application (free or not) to
[quoted text clipped - 19 lines]
>
> I hope I explained myself...
Mark Space - 20 Dec 2007 18:05 GMT
> If the project would be more complex, I would consider using a version
> control system and storing separate branches for different
> environments.

This actually sounds kind of yucky.  Different branches are the same as
different source files.  You probably don't want to maintain one source
file per environment.  This sounds like a maintenance nightmare.

What you want is a single file that does everything, in any environment.
 Then either configure it at runtime (some sort of config.xml in the
resource file, for example) or have a much smaller set of objects which
are specific to the environment, where your environment specific
behavior is encapsulated.

Using branches is just an invitation to make branches everywhere.  You
don't want to do that.
Lew - 21 Dec 2007 03:21 GMT
>> If the project would be more complex, I would consider using a version
>> control system and storing separate branches for different
[quoted text clipped - 12 lines]
> Using branches is just an invitation to make branches everywhere.  You
> don't want to do that.

Upthread the word "connection" was bandied about as a consideration.

There are five or six database systems out there that you can say, "Use one of
these" and not risk losing too many customers.  Load all six drivers.

Add six configuration URLs to your properties files.

Cycle through all known ones when the application inits - if you haven't hit
one after list end, sound the klaxons.

Allow customers to install a db.properties file that specifies their oddball,
shoulda-gotten-Postgres discount-store piece o' De BMS, and scan said
properties file if present, and hey, presto!, you don't even need to sweat
those scenarios.

Signature

Lew

gmannelli@gmail.com - 21 Dec 2007 09:49 GMT
> > arima...@gmail.com wrote:
>
[quoted text clipped - 34 lines]
>
> - Mostra testo tra virgolette -

That's true about the different sintax of the connection string but I
was talking about the different values contained in it, host name,
username etc...
Lew - 21 Dec 2007 16:00 GMT
> That's true about the different sintax of the connection string but I
> was talking about the different values contained in it, host name,
> username etc...

Yes?  How does that impact the advice I gave?

If you know the values up front, as you must to build them into the
application, then you put them in the files as I outlined.  Capisce?

Signature

Lew

gmannelli@gmail.com - 24 Dec 2007 08:07 GMT
> gmanne...@gmail.com wrote:
> > That's true about the different sintax of the connection string but I
[quoted text clipped - 8 lines]
> --
> Lew

E' differente, di driver classes puoi averne al massimo cinque o sei
ma di connection string poi averne anche un centinaio, sarebbero
troppi 100 o piu' file da gestire. Understand?
Lew - 24 Dec 2007 17:39 GMT
>> gmanne...@gmail.com wrote:
>>> That's true about the different sintax of the connection string but I
[quoted text clipped - 11 lines]
> ma di connection string poi averne anche un centinaio, sarebbero
> troppi 100 o piu' file da gestire. Understand?

No.

Signature

Lew

Lew - 24 Dec 2007 17:42 GMT
>>> gmanne...@gmail.com wrote:
>>>> That's true about the different sintax of the connection string but I
[quoted text clipped - 10 lines]
>
> No.

Actually, I do, sort of.  You're saying that there are many, many
possibilities for the strings involved, yes?

In that scenario most folks modify the deployment file in the field, i.e., on
site.  This turns out to be much less labor for most than separate builds.
The work can be minimized by having an installer script or program that
solicits significant input at installation time, like, "What is your database
server?"

The reason Java and other platforms seek to be "Write Once" is that rebuilds
are more expensive (in human resource terms) than installer-program prompts.
The fewer different builds you have to maintain, the easier it is, and
therefore less expensive, to maintain the software.

Signature

Lew

gmannelli@gmail.com - 27 Dec 2007 07:44 GMT
> > gmanne...@gmail.com wrote:
> >>> gmanne...@gmail.com wrote:
[quoted text clipped - 31 lines]
> --
> Lew

And a software suitable to do that work is what I am looking for! The
software that I am talking about is something that ask you for all the
configuration once and each time you release a patch or a new version
it remember your answers...

Anyway compliment, you got the what I mean in the previous post
Mark Space - 28 Dec 2007 01:46 GMT
> And a software suitable to do that work is what I am looking for! The
> software that I am talking about is something that ask you for all the
> configuration once and each time you release a patch or a new version
> it remember your answers...

Ant.  And any IDE.  Or most anything else.

You give ant a build script.  Most are very simple.  It remembers the
build scrip ('cause it lives on your hard drive).  You rebuild the
project, Ant remembers the configuration and rebuilds that.  Tricky Ant
build scripts can build multiple targets from one build script.  In
fact, that's normal.  Most projects have at least a debug version of the
project vs. a release version.

Don't like Ant? Let an IDE make pretty pictures for you.  Same deal
though.  It'll make a build script for you, which lives on the hard
drive in your project folder.  Open the project, click the build button,
it runs the Ant script for you.

You could do this easily with a bash script though.  Just do it....
Marcelo Morales - 24 Dec 2007 11:50 GMT
On Dec 19, 9:37 am, gmanne...@gmail.com wrote:
> Hello All!
> Anybody of you knows if there is any application (free or not) to
[quoted text clipped - 19 lines]
>
> I hope I explained myself...

Two possibilities:

1 Use maven (http://maven.apache.org) and maven profiles (http://
maven.apache.org/guides/introduction/introduction-to-profiles.html).
Create a profile for each customer and code into different
directories. You will need to check out the resources plugin and the
compiler plugin to achieve what you want.

2 Just branch the whole thing on the scm. Merge into the branch
regularly and just change what must be different on that branch.

Saludos

Marcelo Morales


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



©2009 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.