From: brett l. <wak...@gm...> - 2006-07-11 20:19:31
|
On 7/11/06, John A. Tamplin <ja...@ja...> wrote: > brett lentz 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? > > > > > It would seem better to have them related to how they are used, rather > than just grouping them because they are constants. For example, a > constant describing the type of a junction on a tile has no business > being lumped together with a constant definition of the number of pixels > offset for some graphic object. > > This will add unnecesary coupling between classes. > > If the values are really duplicated, then a better solution would be to > remove the duplication and use one canonical source. > Of course. I was more meaning things like the many static strings that we use on buttons and labels (e.g. "ok" and "done") or static numbers like SQRT3 that are duplicated across the GUI files, etc. All of the more specific variables, I'm not interested in touching. ;-) ---Brett. |