LoggableComponent ?
Rod Widdowson
rdw at steadingsoftware.com
Wed Jun 19 03:51:36 EDT 2013
> How do you feel about a new LoggableComponent interface to standardize
> the getLogPrefix() method introduced into the attribute filter and
> resolver ?
Well yes.... but no.
To my mind since this is function which is only of use within the class and
its children I think that an interface is overkill; I just don't see what it
buys us. After all, this is not something that we want have available to
other classes; indeed quite the contrary - it is purely a convenience
mechanism within a class and its children to make sure that all log messages
look consistent. Or am I missing something?
To my mind it makes sense to push it as deep into the class hierarchy as
make sense (so as
BaseAttributeResolver/BaseAttributeFilter/BaseDataConnector all implement
this - or could do).
"Up to a point", I would not be against seeing it pushed down to the base
Identifiable classes (since the paradigm used throughout the code is the
same and the only variant is the prefix). But this falls into complexity
really soon:
- We'd need to add a new method to them to set the prefix
- Then we'd need to ensure that it was non null in the initialize call,
- Which would break all the users of the code who are not us
- And probably cost us a new revision of java-support
So, yes I'd like to do that, but I’d like to have done it 12 months ago...
Of course there is no reason not to add a
"AbstractIdentifiableInitializableWithLogprefixComponent" if you want, but
that doesn't fill me with glee...
Rod
More information about the dev
mailing list