Attribute Access in HTTPResource and Subclasses Inconsistency

Hi all,

during the process of writing new resources and extending already 
available ones, I found an inconsistency I can't explain myself:

Most classes that inherit from HTTPResource add some attributes to the 
attribute database. Usually, these classes define read access functions 
(e.g. getSomeAttribute) as well, but they do NOT provide the 
appropriate write access functions (e.g. setSomeAttribute).

The only solution to set attribute values from outside the class is a 
public method called setValue. The drawback is that you have to supply 
an attribute index. These indexes exist but unfortunately they are 
"protected". Therefore you have to inherit from that class in order to 
access these indexes.

OK, this was the foreword. Now the question: Why are there no write 
access functions defined but a setValue method that is basically 
unusable due to the fact that all indexes are protected.

From my point of view leave the indexes protected and make setValue 
protected as well. Furthermore, add write access functions where 
appropriate (i.e. for the editable attributes only).

Regards
	Alexander Richter



--
Alexander Richter | National Research Center for Information Technology
GMD FOKUS         | Research Institute for Open Communication Systems
                  | Voice: +49-30-3463-7287      Fax:+49-30-3463-8000
                  | Email: richter@fokus.gmd.de
                  | URL:   http://www.fokus.gmd.de/usr/richter
                  | Kaiserin-Augusta-Allee 31, 10589 Berlin, Germany

Received on Friday, 24 October 1997 05:59:45 UTC