Summary: | JMSAppender JMS properties unaccessible to subclasses | ||
---|---|---|---|
Product: | Log4j - Now in Jira | Reporter: | John Rimell <john> |
Component: | Appender | Assignee: | log4j-dev <log4j-dev> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | P2 | ||
Version: | 1.2 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All |
Description
John Rimell
2005-08-01 20:38:40 UTC
1.2.12 candidate I'd be okay with adding accessors, but protected variables are problematic and we shouldn't be adding to the ones that we already have. Do you think you need mutators too? Actually, in this case I think that protected member variables are a better solution. Opening these members to be accessed via getter methods will also open them up to being manipulated by other entities besides subclasses of JMSAppender. Any class could access the getter methods and then use the returned object to do whatever it wants. It implies a contract with the outside world that it is ok to get and manipulate these member variables, which it isn't. Whereas if they are just changed to protected, only subclasses can screw things up, but we expect them to be a bit more knowleable. Doh. Of course, protected accessor/mutator methods would solve what I was just talking about. Sorry, I have been working just plain old bean objects now for too long, obviously. I would only add the accessor ones and not mutators. Added protected accessors for the JMS member variables. Subclasses should be able to use these to get at the values need to override other methods to change behavior. |