S
Spitfire
I have a class which takes an input and produces an object. Let's
say, it takes inputs about specifications of a life-form, and then
creates it (instantiates say an object, 'LifeForm'). Let's call this
factory class 'Creator'. Now, my problem is how do I ensure that once
'Creator' returns a 'LifeForm', any external/requestor class can only
view the properties of LifeForm, that were set during creation, and not
be able to modify them???
How do I design these imaginary classes 'Creator' and 'LifeForm'?
say, it takes inputs about specifications of a life-form, and then
creates it (instantiates say an object, 'LifeForm'). Let's call this
factory class 'Creator'. Now, my problem is how do I ensure that once
'Creator' returns a 'LifeForm', any external/requestor class can only
view the properties of LifeForm, that were set during creation, and not
be able to modify them???
How do I design these imaginary classes 'Creator' and 'LifeForm'?