[OpenAFS-devel] Java API for AFS Admin -- CORRECTION!

Derek Atkins warlord@MIT.EDU
19 Mar 2002 17:20:35 -0500


"Leo Luan" <luan@almaden.ibm.com> writes:

> The problem with getCreator returning a User object is that a Group could
> actually be the creator (e.g. system:administrators is the creator of
> system:administrators), and Java doesn't support covariant types.  The
> underlying native library refers to the creator by name and id, and we
> found this useful; and the user of the API could determine whether it's a
> user or a group from the id and then construct the appropriate object with
> name if needed.

Perhaps the way to do this is to define a "PtsEntry" Interface and have
both User and Group classes implement the PtsEntry Interface.  Then the
getCreator method can return a PtsEntry.

The reason for this approach is that users and groups do have similar
actions that can be done, but it's certainly true that there are
differences, too.  However, it's clear that you could generalize a
common Interface and use that to share method interfaces for return
values.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available