[ajug-members] multiple jar versionsfor one application

Dewberry, Jim jdewberry at connecture.com
Thu May 1 14:24:36 EDT 2008


If you want to have two different behaviors, you might consider using
the Factory design pattern, and/or the Strategy design pattern.

 

http://en.wikipedia.org/wiki/Factory_method_pattern

http://en.wikipedia.org/wiki/Strategy_pattern

 

________________________________

From: Carl Hall [mailto:carl.hall at gmail.com] 
Sent: Thursday, May 01, 2008 11:43 AM
To: ajug-members at ajug.org
Subject: Re: [ajug-members] multiple jar versionsfor one application

 

You can't have 2 versions of the same jar in the same classloader
because they will collide.  First jar loaded by the classloader will be
the one that is available.  To have 2 versions of the same class, you'll
need to change the package or class name.

 

 

On 5/1/08, 521 <521 at ofig.org> wrote:

i am a java beginner, but from what i've read- it's looked at by name, i
would think it would have to be

org.chrisabney.functors.WorkerBee-v1
vs.
org.chrisabney.functors.WorkerBee-v2

-or the like/whatever_name(s)...?  not sure...

barclay

On Thu, 1 May 2008 10:25:21 -0400, Chris Abney wrote

> Does any one know of a good way to access multiple versions of the
same
> Jar file from one application.
>
> For example:
>
> public class myClass {
> :
>   public void doIt() {
>      org.chrisabney.functors.WorkerBee daddyBee = new
> org.chrisabney.functors.WorkerBee();  //The older version
>      org.chrisabney.functors.WorkerBee sonBee   = new
> org.chrisabney.functors.WorkerBee();  //The newer version
>
>      daddyBee.doIt(); //The old boring way
>      sonBee.doIt();   //The new wacky way
>   }
> }
>
> Chris Abney
>
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members


_______________________________________________
ajug-members mailing list
ajug-members at ajug.org
http://www.ajug.org/mailman/listinfo/ajug-members

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20080501/d42366e1/attachment-0001.html 


More information about the ajug-members mailing list