Function-string inheritance

The ability to share function-string definitions among classes by creating relationships between classes is called function-string inheritance.

Using function-string inheritance in general, and inheriting from system-provided classes in particular, provides both administrative and upgrade benefits to replication system administrators. Using classes that inherit from system-provided classes, you alter only the function strings you want to customize and inherit all others.

If you use classes that do not inherit from system-provided classes, you must create all function strings yourself, and add new function strings whenever you create a new table or function replication definition.

A class that inherits function strings from a parent class is called a derived class. A class from which a derived class inherits function strings is called the parent class of the derived class. Generally, you create a derived class in order to customize certain function strings and inherit all others from the parent class.

A class that does not inherit function strings from any parent class is called a base class. The system-provided classes rs_default_function_class and rs_db2_function_class, and any additional classes you create that do not inherit function strings from a parent class, are base classes. The system-provided classes rs_iq_function_class, rs_msss_function_class, and rs_oracle_function_class are derived from rs_default_function_class.

A parent class can have multiple derived classes, while a derived class can have only one parent class. A derived class can also serve as the parent class for one or more derived classes. A set of derived classes of any number of levels stemming from the same base class is called a class tree.

The system-provided classes rs_default_function_class and rs_db2_function_class can serve as parent classes for derived classes. However, they cannot become derived classes of other parent classes.

The system-provided class rs_sqlserver_function_class cannot serve as a parent class or become a derived class.

A base class that you have created can be modified to become a derived class, or it can be designated as the parent class for a derived class. A derived class can be modified to inherit function strings from a different parent class, or it can be detached from a parent class and become a base class.

For every base class that you create, you must provide function strings for the functions that Replication Server invokes in each database to which the class is assigned. If you assign a function-string class to a database when some of the function strings for system functions are missing, the DSI reports an error when Replication Server tries to apply the function string, and suspends the database connection.

Circular function-string inheritance relationships are disallowed. That is, a parent class cannot be modified to inherit function strings from one of its own derived classes or from a derived class of one of these derived classes.

Function-string class relationships are illustrated in Figure 2-1.

Figure 2-1: Function-string class relationships

Figure 2-1 illustrates the function dash string class relationships. This example includes relationship for some function classes with their corresponding derived classes.