J
Jakob Bieling
Hi,
I am in a situation where I need a language feature, which I am not
sure exists. I have two classes, one (let's say A) contains a list of
data and the other (say B) contains the functionality to display that
list. Now I want to have private data inside A, which should not be
accessed by user code. Problem is, that I want B to have access to this
data as well.
The only 'solution' I can come up with, is to make that data public
and document that it must not be modified. Does not feel like clean code
tho. I am also trying to avoid sophisticated work-arounds, since the
code will run on devices with very limited memory and cpu.
Thanks for your help!
I am in a situation where I need a language feature, which I am not
sure exists. I have two classes, one (let's say A) contains a list of
data and the other (say B) contains the functionality to display that
list. Now I want to have private data inside A, which should not be
accessed by user code. Problem is, that I want B to have access to this
data as well.
The only 'solution' I can come up with, is to make that data public
and document that it must not be modified. Does not feel like clean code
tho. I am also trying to avoid sophisticated work-arounds, since the
code will run on devices with very limited memory and cpu.
Thanks for your help!