commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONFIGURATION-543) Make some methods in AbstractConfiguration final to prevent that subclasses break basic functionality
Date Fri, 03 May 2013 19:34:16 GMT
Oliver Heger created CONFIGURATION-543:
------------------------------------------

             Summary: Make some methods in AbstractConfiguration final to prevent that subclasses
break basic functionality
                 Key: CONFIGURATION-543
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-543
             Project: Commons Configuration
          Issue Type: Improvement
    Affects Versions: 1.9
            Reporter: Oliver Heger
             Fix For: 2.0


{{AbstractConfiguration}} already implements a significant amount of basic functionality,
e.g. event firing. In addition, for many methods of the {{Configuration}} interface base implementations
are provided.

In many cases, methods do some book-keeping stuff (for instance sending event notifications
or synchronization handling) in addition to the actual functionality. If now subclasses override
such methods, they have to repeat the book-keeping logic. There is a high risk that this logic
gets forgotten or broken if a method is overridden.

To avoid this, {{AbstractConfiguration}} should have *final* methods which implement the necessary
book-keeping stuff and then delegate to *protected* methods (either abstract ones or with
base implementations) which can be overridden by subclasses. That way functionality can be
added or adapted by subclasses, but basic features cannot be broken and do not have to be
re-implemented.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message