commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <>
Subject RE: [configuration] Extending the Map interface
Date Tue, 16 Dec 2003 11:49:12 GMT
[configuration] Extending the Map interfaceI can't remember where I read
about it, but I think that we are usin Composition versus inheritance..  If
we did inherit from map, that would be cool, except that then you could pass
a configuration object into all kinds of weird places..   Now, with some it
might work, but with others it might break.  And it means that we can never
inherit from something else..

Maybe instead a better approach would be MappableConfiguration or
MapConfiguration that was a decorator and exposed all those configuration
values as map for places where you wanted to treat the Configuration
interface as a Map...

  -----Original Message-----
  From: Emmanuel Bourg []
  Sent: Tuesday, December 16, 2003 10:56 AM
  To: Jakarta Commons Developers List
  Subject: [configuration] Extending the Map interface

  While implementing the ReloadableConfiguration i had to add a clear()
  method to the Configuration interface. That made me think that a
  Configuration is basically a Map with convenient accessor methods and
  casting the values to the desired type. So what about extending Map in
  the Configuration interface ? That would make sense since Configuration
  is defined as an extended Properties, and Properties implements Map.

  Emmanuel Bourg

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