abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: Abdera and Singleton
Date Wed, 19 Sep 2007 21:12:53 GMT
We could probably add this, but for a variety of classloader related
reasons, it's likely that it would not be a complete replacement for the
new Abdera() approach.

- James

Fred wrote:
> Hi,
> 
> I am using Abdera, and I remark that created a new instance of Abdera can be
> long.
> 
> Can Abdera Class implement Singleton pattern ?
> 
> You have to add this code in Abdera Class
>     private static Abdera abdera;
> 
>     public static Abdera getInstance() {
>         if(abdera == null) {
>             abdera = new Abdera();
>         }
>         return abdera;
>     }
> and replace all "new Abdera()" by Abdera.getInstance().
> 
> What do you think of this solution ?
> 
> Regards,
> Frederic
> 

Mime
View raw message