PreviousNext

Adding an Interface Rather than Changing One

An interface can inherit the features of another interface; thus not only do you have class hierarchies, but you also can have interface hierarchies as well. We suggest that you add more interfaces rather than change an existing one, even though IDL provides for different interface versions. Reasons for this include the following:

· Adding an interface will self-document new features. There is no way for a developer to know which operations are old and which are new unless they compare the old and new interfaces or the interface designer has documented where the new operations begin.

· Adding an interface will not break the interface hierarchy. Adding additional operations to a base class can be a problem for applications.

· Adding an interface allows you to bypass the tedious procedure for changing an interface and its version numbers.