Combining components and creating views.

Integrating Extension and Specialization Inheritance
by Walid Al-Ahmad and Eric Steegmans
Listing 2. Combining components and creating views.


abstract class PERSON combine
   {NAME, BIRTHDATE, ADDRESS, HEIGHT}
creation make
feature
      abstract make(name : STRING, dob : DATE,
         adr : ADDRESS, ht : REAL) is
    -- other constructors, if any
end
view AVIEW is PERSON
   {NAME, ADDRESS, BIRTHDATE, HEIGHT}
      feature
                make(name : STRING, dob : DATE, adr :
                    ADDRESS, ht : REAL ) is
                do Name := name; BirthDate := dob; Address := adr;
                    Height := ht end
end
view MYVIEW is PERSON {NAME, BIRTHDATE}
      feature
      make(name : STRING, dob : DATE) is
                do Name := name; BirthDate := dob end
end