space
Previous Page | Next Page

SAS Object-Oriented Programming Concepts

Interfaces

Interfaces are collections of abstract method definitions that define how and whether model/view communication can take place. They enable you to redirect a method call from one component to a method call on a different component. The method definitions are just the information that is needed to define a method; they do not contain the actual method implementations. If two components share an interface, they can indirectly call each others' methods via that interface.

Interfaces are stored in SAS catalog entries of type INTRFACE. For example, the staticStringList interface is stored in the sashelp.classes.staticStringList.intrface catalog entry.

To retrieve the methods that an interface supports, use the _getmethod or _getmethods methods.


Interface Properties of a Class

A class can be defined to support or require one or more interfaces. For example, model/view component communication is implemented with the use of interfaces. The model typically supports the interface, whereas the view requires the same interface. The interfaces for the components must match before a model/view relationship can be established.

A class stores interface information as a property to identify whether it supports or requires an interface. Interface data on a class consists of the following items:

State

specifies whether the interface is New or Inherited.

InterfaceName

specifies the four-level catalog entry name of the interface class (such as sashelp.classes.staticStringList.intrface).

Status

indicates whether the interface is Required or Supported.

Although classes that support or require an interface are often used together, they are still independent components and can be used without taking advantage of an interface.

For more information on interfaces and their use, see Implementing Model/View Communication.

space
Previous Page | Next Page | Top of Page