From: Jean-Pierre D. <jea...@tr...> - 2003-10-15 00:35:18
|
Ahh... I was sure you were talling about the "new" fact that an ancestor does ha= ve access to child data thru the introduced variant... The encapsulation issue also exists for embedded clusters datatypes. It m= ay be possible for Class Get Data.vi to cast, unbundle and return only the class specific data. More easily with inheritance cluster= s since class specific data is bundled in a cluster. The problem I see actually is that the parent class isn't always aware when i= ts data is accessed so it may be important that either a) the clild can't access parent data at all or b) it is allowed to modify i= t but all the ancestors Get/Set Data methods are invoked to notify that the data is accessed and modified. Maybe two methods can be u= sed: Get/Set Class Data to access class specific data only and Get/Set Object Data to access all object data. In the latter, Get/Set= methods are invoked for all classes to access data. It is also important for the object to have private data (not get/set out= side the class) like internal state variables. These shouldn't be affected by get/set data operation on public variables. This= private data need to be store in the object data space too. Jean-Pierre ----- Message d'origine -----=20 De : "Jim Kring" <ji...@ji...> =C0 : <ope...@li...> Envoy=E9 : 13 octobre, 2003 22:23 Objet : RE: [opengoop] Virtual Methods (Abstraction) Jean-Pierre, Actually what I am talking about is the inverse. I am not too concerned with an ancestor having access to descendant data, but rather I am concer= ned with a descendant having access to ancestor's private data. Right now th= ere is no distinction between private data and public data -- all object data= is public. Therefore, a class cannot protect itself from a descendant that doesn't fully understand its implementation (and descendants shouldn't ha= ve to understand). Maybe there could be two types of data storage, public a= nd private. Public data would be accessible to the descendants, via their object data clusters, and private data would not be accessible to descendants. Private data will not need an inheritance scheme since it i= s only available to one class-level. -Jim |