dev@glassfish.java.net

Re: Local Strings in GlassFish

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Tue, 20 Jul 2010 20:04:06 -0700

Vince, Byron,

What's the difference between this proposal and existing
StringManager.getManager(Foo.class) that is already in place?

thanks,
-marina

vince kraemer wrote:
> Tom: Thanks for the pointer to a prototypical case...
>
> All:
>
> After reading through the diff, I have to wonder... why not replace
> 'new LocalStringsImpl(Foo.class)' with
> 'LocalStringsImpl.getInstance(Foo.class)' where getInstance(Foo.class)
> would manage the instances of LocalStringsImpl.
>
> An initial impl of getInstance(Foo.class) would just do a new... later
> the getInstance could manage a cache of LocalStringsImpl instances,
> indexed by the package of the class sent in...
>
> That would probably help prevent the instance explosion that seems to
> be the motivation for this change.
>
> It seems like this would prevent a lot of code duplication, since
> there would need to be over 250 Strings.java classes written to
> implement this proposal across the GlassFish Server 3.1 code base. Any
> change that needs to be made to Strings would need to be made 250+
> times, too.
>
> But I am probably missing something obvious...
>
> vbk
>
> Tom Mueller wrote:
>> Here you go:
>>
>> http://fisheye4.atlassian.com/changelog/glassfish-svn?cs=37341
>>
>> This change has a bit more than just the Strings.java change.
>>
>> Tom
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>