Internal and Expanded

Revision as of 10:32, 23 March 2010 by Manus (Talk | contribs)

We are discussing here how to export the description of expanded fields in a normal object to enable a fast and efficient introspection of objects at runtime. We will describe the various possibilities the last one being the implementation we have chosen in EiffelStudio.

To make the discussion consistent, let's suppose we have the following set of classes:

class A
feature
	b: B
	sa: STRING
end
 
expanded class B
feature
	c: C
	sb: STRING
end
 
expanded class C
feature
	sc: STRING
end

Nothing special

As of version 6.5 and before of EiffelStudio, one can use `field' and `set_field' to get and set the expanded attributes

pros: simple cons: very inefficient

Extra fields

The attributes of the expanded are also visible as extra fields of the object. In other words