W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1997

Attribute Access in HTTPResource and Subclasses Inconsistency

From: A. Richter <richter@fokus.gmd.de>
Date: Fri, 24 Oct 1997 11:59:17 +0200
Message-Id: <199710240959.LAA07187@aquarius.fokus.gmd.de >
To: www-jigsaw@w3.org

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).

	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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:31 UTC