On 3/27/06, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
>
> I've noticed that both DefinitionsFactory and ComponentDefinitions are
> both too (IMHO) tightly bound to the Locale.
> What I mean is that maybe using Locale class to distinguish between
> different sets of definitions is not a good idea. From my point of view,
> I think that where you are using Locale maybe it should be used a simple
> Object.
> This way you leave to the implementation what's the use of that "Locale"
> In the Struts-Tiles version there is the concept of "key" in the
> FactorySet.createDefinitionsFactory, that is a simple Object. I use it
> to do my own way to localize definitions.
> In other words, don't you think that "Locale" in those interfaces should
> be Objects?
> Ciao
> Antonio


One of the reasons I think using a Locale is a good choice is that you'll
need one later on anyway ... to generate Locale-sensitive date formats, for
example.  It is also the mechanism used universally throughout Java for this
kind of decision.  Finally, Struts already keeps track of the current Locale
for a user in a session variable, so it's easy to grab when you need it.
(JSF and other frameworks do the same sort of thing too.)

Craig

Reply via email to