Patch for MsgBase was [jsword-devel] MsgBase bug

DM Smith jsword-devel@crosswire.org
Mon, 12 Apr 2004 23:00:53 -0400


I have thought about whether having MsgBase be an Enum.
I don't think that we use it as an Enum (ala apache) but it is very valuable 
to have it be separate message objects because we can enforce i18n at 
compile time.

So I think that we should use the "type safe enumeration pattern". That is, 
take extends Enum off of MsgBase and leave the rest of the class the same. 
Is this what you are thinking? Would that be light enough?


Joe Walker writes:
>
>
>Checked-in now.
>Along with quite a bit of i18n work. I turned on non-i18n warnings and 
>deprecated LogicError and watched in horror as the warnings went from 0 to 
>over 4000!
>
>We're back to 500 now, but they are the harder ones.
>
>I've not been doing the whole job; I'm only moving the english strings to a 
>Msg file - so it would make sense to invent a macro to finish the job at 
>some stage.
>
>Thought: Is there any good reason why MsgBase is-a Enum?
>I think there are some interesting possibilities in being able to write a 
>GUI to allow users to create i18n files for themselves and this requires 
>that MsgBase collects the i18n-able strings in some way, but I suspect Enum 
>isn't the right solution given the previously noted inheritance problems.
>In addition it would make sense to make MsgBase as lightweight as possible. 
>So I'm tempted to make MsgBase keep track of the name itself without 
>needing a parent, and to make it keep track of all i18n-able strings better 
>than Enum does.
>
>Another thought: Create proxies around the entire swing API and the alter 
>the parameters of all methods that display their strings to take MsgBase - 
>more enforced i18n. You could also create a second implementation along the 
>same lines, but that called SwingWT instead.
>I don't propose doing anything about this idea at all but it did seem neat.
>
>Joe.
>
>DM Smith wrote:
>>Joe Walker writes:
>>>Thanks for this. I've not had change to look at it, and to be honest I 
>>>doubt I will this evening, and I'm likely to be a bit short of time 
>>>tomorrow evening too. Sorry.
>>>I'll apply it as soon as I can.
>>
>>No problem. Take your time. I know that sometimes the software that I 
>>write is non-trivial and takes some looking at to understand.
>
>_______________________________________________
>jsword-devel mailing list
>jsword-devel@crosswire.org
>http://www.crosswire.org/mailman/listinfo/jsword-devel

_________________________________________________________________
Limited-time offer: Fast, reliable MSN 9 Dial-up Internet access FREE for 2 
months! 
http://join.msn.com/?page=dept/dialup&pgmarket=en-us&ST=1/go/onm00200361ave/direct/01/