commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <benerit...@gmail.com>
Subject Re: svn commit: r1405889 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration: Configuration.java ImmutableConfiguration.java
Date Tue, 06 Nov 2012 08:25:17 GMT
Hi Jörg,

specialization between two concpets in the oo paradigm has the semantics of
a is-a-relationship. So if Configuration extends ImmutableConfiguration
that means (at least for me) that a Configuration is a
ImmutableConfiguration.
That's what I meant with my first comment.

About merging the two:
If there is no class that implements ImmutableConfiguration and no
interface other then Configuration that extends it. What is the point of
having it in the first place?
For example the two could be merged together and a class
AbstractImmutableConfiguration could implement the merged Interface (let's
call it Configuration). That class would throw
UnsupportedOperationException if one of the write methods is called.
This would be like the definition of Collection.add(E o). Subclasses may
implement the add operation but can also chose not to.

Benedikt


2012/11/5 Jörg Schaible <joerg.schaible@gmx.de>

> Benedikt Ritter wrote:
>
> > 2012/11/5 Benedikt Ritter <beneritter@gmail.com>
> >
> >> Hi Oliver,
> >>
> >>
> >> 2012/11/5 <oheger@apache.org>
> >>
> >> Author: oheger
> >>> Date: Mon Nov  5 17:29:01 2012
> >>> New Revision: 1405889
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1405889&view=rev
> >>> Log:
> >>> Initial version of an immutable configuration interface.
> >>>
> >>> Added:
> >>>
> >>>
>
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/ImmutableConfiguration.java
> >>>   (with props)
> >>> Modified:
> >>>
> >>>
>
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/Configuration.java
> >>>
> >>> Modified:
> >>>
>
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/Configuration.java
> >>> URL:
> >>>
>
> http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/Configuration.java?rev=1405889&r1=1405888&r2=1405889&view=diff
> >>>
> >>>
>
> ==============================================================================
> >>> ---
> >>>
>
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/Configuration.java
> >>> (original)
> >>> +++
> >>>
>
> commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/Configuration.java
> >>> Mon Nov  5 17:29:01 2012
> >>> @@ -17,11 +17,6 @@
> >>>
> >>>  package org.apache.commons.configuration;
> >>>
> >>> -import java.math.BigDecimal;
> >>> -import java.math.BigInteger;
> >>> -import java.util.Iterator;
> >>> -import java.util.List;
> >>> -import java.util.Properties;
> >>>
> >>>  /**
> >>>   * <p>The main Configuration interface.</p>
> >>> @@ -54,7 +49,7 @@ import java.util.Properties;
> >>>   * @author Commons Configuration team
> >>>   * @version $Id$
> >>>   */
> >>> -public interface Configuration
> >>> +public interface Configuration extends ImmutableConfiguration
> >>>
> >>
> >> A Configuration IS_A ImmutableConfiguration sounds rather akward. The
> >> JavaDoc of ImmutableConfiguration says "The main interface for accessing
> >> configuration data in a read-only fashion." Maybe ImmutableConfiguration
> >> should be renamed to ReadOnlyConfiguration?
> >>
> >> Regards,
> >> Benedikt
> >>
> >
> > Looking at the code base, there is no class that implements
> > ImmutableConfiguration directly and Configuration is the only interface
> > that extends ImmutableConfiguration. So maybe the two can be merged
> > together?
>
> And why do YOU think, that an immutable and a mutable Configuration is the
> same thing? Sorry, your comments do not make any sense to me!
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message