From: brett l. <wak...@gm...> - 2006-07-11 20:30:02
|
On 7/11/06, Erik Vos <eri...@hc...> wrote: > > I've noticed that we've got a ton of constants that are duplicated > > across our source tree. > > > > Does anyone object to me creating a single Constants class-file that > > holds all of these items and relocating all of our constants into this > > central file? > > I presume you are only talking about public constants. > Protected and private ones have only local significance > and should stay where these are anyway. > Correct. > Displayed texts should not be constants but be made localisable > by defining these in LocalisedText.properties, and retrieved via > Game.getText(). > > For the rest I concur with John: it is generally better > to keep constants related to classes where they logically > belong to. > > Perhaps the keys of the localisable texts are an exception, > I can imagine putting all these in one class LocalText or such > (this is also the kind of constant that will suffer most from duplication). > Game.getText() could then be moved to that class. > Yeah, this was more along the lines I was thinking. I'll focus just on the localisable texts for now. ---Brett. |