Difference between revisions of "Replication"

(Basic cases of direct repeated inheritance)
Line 21: Line 21:
 
end
 
end
 
</code>
 
</code>
 
+
Lets have look at D1 that repeatedly inherits from B:
 
<code>[eiffel, N]
 
<code>[eiffel, N]
 
class
 
class
Line 34: Line 34:
 
</code>
 
</code>
  
 
+
And an informal description of the semantics: An object of class D1 contains two physical attributes (f_1 and f_2). A call to feature g_1 results in f_1 being incremented and a call to g_2 increments f_2.
An object of class D1 contains two physical attributes (f_1 and f_2). A call to feature g_1 results in f_1 being incremented and a call to g_2 increments f_2.
+

Revision as of 09:21, 25 August 2006


Work in progress!

We start with some very basic examples, for this we consider all the classes not to be inherited by ANY.

Example set

Basic cases of direct repeated inheritance

The following set of example will base on class B:

class
   B
feature
   f: INTEGER
   g
      do 
         f := f + 1 
      end
end

Lets have look at D1 that repeatedly inherits from B:

class
   D1
inherit {NONE}
   B
      rename f as f_1, g as g_1 end
   B
      rename f as f_2, g as g_2 end
feature
end

And an informal description of the semantics: An object of class D1 contains two physical attributes (f_1 and f_2). A call to feature g_1 results in f_1 being incremented and a call to g_2 increments f_2.