Menu

#29 IConfigSource.Configs property breaks decoupling

open
5
2006-05-25
2006-05-09
Anonymous
No

Because of this...

public interface IConfigSource
{
ConfigCollection Configs {get;}
...
}

combined with this...

public class ConfigCollection
{
public ConfigCollection(ConfigSourceBase owner);
}

... it isn't possible to implement IConfigSource
without sub-classing ConfigSourceBase.

There are two possible resolutions:

1. Property IConfigSource.Configs should return an
IDictionary

2. The type of the owner passed to the ConfigCollection
should just be IConfigSource

Solution #1 involves more code changes, but results in
a cleaner interface.

Solution #2 requires minimal code changes and doesn't
break any of the unit tests.

Discussion

  • Brent R. Matzelle

    • assigned_to: nobody --> bmatzelle
     
  • Brent R. Matzelle

    Logged In: YES
    user_id=163900

    That's a very good point. Thank you for catching that for me.

     

Log in to post a comment.