Special class for constants

Interesting idea, Toch.

<CC-ing to jalview-dev. Please reply to the list!>

I'm not convinced all 'public static final' values should be stored in a
single class for the whole codebase. It provides some convenience - but
also risks dependency problems, and can easily become unmanageable.

I think it may be necessary to have a dedicated class (i.e.
Jalview.util.Constants) for keeping constants used in Jalview,
especially those widely utilise across different classes/packages.
The class should contain solely constants and NO methods.

If there are constants that are defined and used *independently* from
other methods in a class then they ought to be defined where they are
used, period.

If they are used in multiple places then they could usefully be
refactored to a jalview.util.Constants class, but it is important to
respect package boundaries. I created JAL-2121 yesterday because we will
need to address the current sprawling dependency tree before we can
create OSGi modules.

This will greatly reduce if not eliminate the problem of unwanted
dependencies creeping in from undesired classes/packages where constants
are defined.

Can you give some examples here ?


On 26/05/2016 17:18, Charles Ofoegbu (Staff) wrote:

Dr JB Procter, Jalview Coordinator, The Barton Group
Division of Computational Biology, School of Life Sciences
University of Dundee, Dundee DD1 5EH, UK.
+44 1382 388734 | www.jalview.org | www.compbio.dundee.ac.uk