A useful, general OOP pattern

Emmanuel Briot has published an interesting extension to my usual guidelines (happily stolen from the Quality and Style Guide) on declaring tagged types.

Basically the pattern is (in my version):

subtype Parent is Parent_Type_Package.Instance;
type Instance is new Parent with private;
subtype Class is Instance'Class;
type Reference is access all Class; --  Optional, only if you really need access types

What do you think of it?

And do you prefer Emmanuel’s naming style or mine?

Leave a Reply