L
Laura Stern
Guest
In the Reflection specification that was posted for the 11.6 ESAP, it states that once you get an instance of one of the reflection objects, such as Progress.Reflect.Method, or Progress.Reflect.Property, you can invoke that method, or get/set the property value from any piece of code. This is different from the methods on Progress.Lang.Class (P.L.C), such as Invoke or SetPropertyValue. For those methods, normal OO rules apply. Only Public class members can be invoked/set/etc from anywhere. You can use these methods on Private class members only from within the class that owns the element and similarly protected class members can only be invoked/set/etc from a class within the hierarchy. The rationale for allowing the functionality from anywhere is to allow tooling to work or to do things like writing your own serialization facility from outside the class that is being serialized. However, we are considering changing the rules for the new Progress.Reflect objects for 11.6. The default would be that you can only do Invoke/New/Get/Set/Subscribe operations on Public data members, period. So this would actually be a little more restrictive than the current rules. In a later release we can add a way to mark elements (details specifically left out) so that Invoke/New/Get/Set/Subscribe will work on them from anywhere. Alternatively, we can keep the rules the way they are spec'd, i.e., everything is allowed from anywhere, and later add a way to restrict access for particular elements. The option to follow the same rules as the current P.L.C methods is not under consideration. Note that .NET takes the latter approach (accessible, unless work is done to make an element secure). Whereas Java follows the approach of being more restrictive by default. We'd appreciate any feedback on this, specifically use-cases that would call for following one approach vs the other.
Continue reading...
Continue reading...