Structured Inheritance?

Dr. R. J. Botting

Computer Science Faculty Seminar

California State University, San Bernardino

June 2nd 2003

1.           Source

              a.           Dr. Tracy Gardner's Ph. D. Thesis, Bristol U., England

              b.           Inheritance Relationships for Disciplined Software Construction

              c.           Springer Verlag UK 2002

2.           Overview

                            i.            Using 5 special types of inheritance may lead to better software.

              b.           Motivation

              c.           Preliminary Definitions

              d.           Details

              e.           Missing Things

              f.            Summary

3.           Mission

              a.           Make software easier to design, understand, maintain, etc.

4.           Defining Terms

              a.           UML

                            i.            Unified Modeling Language

              b.           Inheritance

                            i.            Allowing a class of objects to be like another class.

              c.           Generalization and Realization

                            i.            The two UML forms of inheritance.

5.           Current Situation

              a.           Using normal inheritance leads to confusion and ambiguity

              b.           Square and Rectangle

              c.           Point and ColoredPoint

              d.           Any Others?

6.           The Problem

                            i.            How to structure OO models better.

              b.           Solution

              c.           

                            i.            Do not use general inheritance!

                            ii.           

                            iii.          Pick special forms of inheritance!

7.           Five Structured Inheritance Relationships

                            i.            SIRs

                                           (1)         Specialization <<spec>>

                                           (2)         Variant <<var>>

                                           (3)         View <<view>>

                                           (4)         Construction <<cons>>

                                           (5)         Evolution <<evol>>

8.           Primary and Secondary

              a.           Gardner has primary and secondary abstractions.

                            i.            Primary classes/types model the domain.

                                           (1)         Define a complete domain ontology.

                                           (2)         They may not refer to secondary types.

                                           (3)         They may not have instance objects

                                                         (a)          I think!

                            ii.           Secondary classes implement the software.

                                           (1)         They may have instances.

                                           (2)         They implement primary types.

9.           A mapping to UML 1.1

              a.           Secondary

                                           (1)         <<implementation class>>

              b.           Primary

                                           (1)         <<type>>

                                                         (a)           {abstract}

10.         Details on the Five SIRs

              a.           Specialization

              b.           Variation

              c.           View

              d.           Construction

              e.           Evolution

11.         Specialization

                            i.            A Special Kind Of

              b.           Primary types only

              c.           Transitive

              d.           Contracts propagate

 

              e.           As old as Aristotle

12.         Variation

                            i.            Same operations but variant behaviors

              b.           Realization of primary.

              c.           Variations of secondary

              d.           All variants are secondary.

              e.           Transitive and propagates contracts.

              f.            Variant of specialization is a variant of the general.

              g.           We use it every day.

13.         View

                            i.            Allow an object to gain new responsibilities

without changing identity.

              b.           A primary or a secondary type can have secondary views

              c.           A view is never primary.

              d.           A view is often a variant of a primary type.

              e.           The object, dynamically, gains the behaviors and constraints defined by the view.

 

              f.            I would like to have a simple way to code views.

14.         View

                            i.            Example: Points and Pairs

              b.            Pair p1 = new Pair;

 

              c.            Point p2 = view p1 via PairAsPoint;

15.         Construction

                            i.            How we combine stereo components into a system.

              b.           Connect parts, hide behaviors.

              c.           In specification languages like Z for years.

              d.           In the UML 1, use composition, realization, and collaborations with OCL specifications.

              e.           We need a simpler way.

16.         Construction

                            i.            Gardner uses generalization with <<cons>>.

              b.           private inheritance.

              c.           Controversial! Many deprecate it.

              d.           "a special kind of association"

              e.           "object-based not class-oriented".

              f.            We should look at other ways to show construction.

              g.           Why not composition?

17.         Evolution

                            i.            Shows that something can change.

              b.           Two meanings.

                            i.            Changes in an object's state

                                           (1)         eg. Advancement to Candidacy

                            ii.           Changes in a class's description

                                           (1)         eg. The addition of a new method.

 

              c.           A change to a class, passes to all subclasses and instances.

              d.           THEN

              e.           Phase out the old class!

18.         Evolution

                            i.            But?

              b.           I like being able to show model changes.

                            i.            A powerful and important idea.

 

              c.           There is a better way for state changes.

                            i.            State-charts or entity life histories handle this better.

                            ii.           Dr. Gardner does not mention them.

19.         Missing => Doubts

                            i.            Dr. Gardner does not

              b.           Mention most of the UML!

                            i.            State charts

                            ii.           Composition, association, aggregation

                            iii.          collaborations (patterns)

                            iv.          etc.

20.         Missing = Future Work

                            i.            Dr. Gardner does not

              b.           Prove anything.

                            i.            Empirically.

                            ii.           Mathematically.

 

              c.           Both are needed!

                            i.            Prove that all inheritance is covered by the 5 SIRs

                                           (1)         Like Boehm and Jacopini

                            ii.           They need to run the gauntlet of the scientific process

                            iii.          Find out how they work in the field.

                            iv.          Develop languages & tools to use them

21.         Any Questions?

                            i.            Five SIRs

22.         Summary

                            i.            Fascinating ideas. But needs review and testing.

              b.           The book

                            i.            explains how the SIRs resolve problems.

                            ii.           compares them with other resolutions.

                            iii.          shows how to code SIRs

                            iv.          has many good examples

BUT

                            v.           has money dump errors.

 

              c.           Dr. Gardner's ideas must not be forgotten.

23.         Any Questions

24.         Thank You for Coming!

                            i.            Don't forget the many presentations being made this week!.

25.         Blank Slide