Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Public vs. Protected visibility of the attributes in Persistent class

Former Member
0 Kudos

Hi,

can some of you kindly explain, why the workbench displays the mapped attribute's visibility as Public in the Attributes tab of the persistent class while it is (correctly) mentioned as with Protected visibility in the Detail view (puzzle icon)? Yes, in principal it should be Protected - and it is, in fact - so I am just curious why the general description says it's Public? Is it a bug or am I missing something?

Thank you

Michal

4 REPLIES 4

Former Member
0 Kudos

Hi,

If it is public means accessible to other classes of outside world ,if it is protected means the subclasses can alo access super class if it is private accessible to that class.

I think that class is reusable thats why they declare it as public.

That is not the bug you are not selecting it as public just thats it.

Regards,

G.Aditya

Edited by: Aditya.G on Oct 3, 2011 10:44 AM

0 Kudos

Hi Aditya,

thank you for that quick reply. But I was not clear enough, maybe. I am familiar with the object development and visibility concept as well. From the visibility point of view, each class component (here: attribute) must be either public or protected or private. It does not make sense (and it breaks all rules) to have it public and protected at the same time - and it is also technically impossible to make it like this manually. Just give it a try yourself: create test ZCL_TEST class and create one attribute with public visibility in it. Then go for details of that attribute and in the 'Detail view' screen for this attribute and change it to Protected. When closing the 'Detail view' sccreen, you can see that the visibility changed in the definition of the attribute as well (and vice versa).

To be more specific and provide better example, I had experimented a bit more (please, note, that this strange behaviour was seen with PERSISTENT classes only):

I created a persistent class, and created the mapping, activated the class. Now I can see that in the Attributes Tab, the mapped attribute is of visibility type Public, but in 'Detail View' screen, it is Protected! This is what turns me crazy. But, I have realized now, that once you change the visibilty (either in Attributes tab or in 'Detail View' for an attribute), the information in those two screens is somehow 'aligned' and the mismatch does not occur from that moment any more... strange.

I am still curious about whether this 'first time display mismatch' of persistent class attribute's visibility makes sense for someone?

Thanks

Michal

matt
Active Contributor
0 Kudos

I'd never noticed that before.

Looking at a newly created persistence class - the entries in the db table SEOCOMPOFG have exposure 1 = protected.

I suspect that somewhere in the code of the Class Builder, there is some incorrect logic that's causing the component to be displayed as public. I.e. it's a bug.

matt

0 Kudos

Thank you Matt, I think the same, so we are two now, therefore it can be established as true statement

Points rewarded, thread closed.

Michal