[Bluej-discuss] private fields of superclass in object inspector

Dr. Michael Städler staedler at baw-hameln.de
Mon Dec 17 08:47:00 GMT 2007


Michael,

your wording on this topic is definitely more precise than mine. 
I understand that you want to show all elements of an object, 
even if they are not accessible, and agree on that. 

Now I have another proposal: Wouldn't it be more clear 
for the user, if there was a visual hint on _all_ inherited 
elements that they are inherited? Inherited methods appear
in a separate submenu. Inherited fields are not marked
in any way. 

Regards,
Michael

> I don't think that it is correct that private fields are not inherited.
> Private fields are not _accessible_ in subclasses, but they are  
> present as part of the state of subclass objects (and must be to  
> support the inherited methods).
> The object inspector in BlueJ shows the internals of an object (for  
> debugging purposes), not the public view.
> So if I create a Student object, which has a 'name' attribute  
> inherited from Person, and I want to check whether it has been  
> initialised properly, or I want to check whether the 'changeName'  
> method works properly, then I need to see the inherited part of the  
> object's state.
> I don't think students can understand inheritance of fields properly  
> if these were not shown.
> Michael

>> ... Just one feature (?) makes me wonder: like my subject  
>> says, it's about private fields of superclasses. They are visible in  
>> instances of subclasses when I look in the "object inspector". This  
>> is in version 2.12 and also in 2.2. Why? Since private fields are  
>> not inherited, wouldn't it be better to not show them accordingly?


More information about the bluej-discuss mailing list