since this is a base class we reuse for most of the version handlers is nice to have a logger already defined that can be reused, instead of creating a new one in any subclass.

bah, defining a private static final logger is cheap.

Also, this causes log entries to be written using a specific logger per subclass, so you can turn on debug for a specific version handler and you immediately know who is the responsible for logging.
That's a valid point indeed. OTOH, as far as I can see, the only reason it's used is to debug-log the getCurrentlyInstalled() method (and in this specific case the log message will tell you what module the version handler is for)

It's pretty common to have non static loggers for classes that are intended to be extended.
I remember seeing an article about this on the slf4j website, but i've never been sure what the conclusions were.

My concerns are:
 - consistency with the rest of the code base
- publishing this logger locks us into maintaining it in future versions (in terms of variable name, type, visibility)

Cheers

g


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to