Tutorial exercise 5: Using interfaces
This exercise demonstrates how to use interfaces to define how one module depends on another. This exercise has 16 steps. It takes approximately one hour to complete
About this task
- The Point module contains the Point opaque data type and the Distance() function.
- The Circle module contains the Circle opaque data type and the Contains() function.
Because the Circle data type has a member of type Point, and the Contains() function uses the Distance() function, the Circle module depends on the Point module. To use the Circle module, users must first install and then register the Point module by using BladeManager.
- If the Point module is already installed on the database server, BladeManager prompts the user to register it and only then proceeds to register the Circle module.
- If the Point module is not installed, BladeManager does not register the Circle module.
In this exercise, however, you use the DBDK Visual C++ Add-In to register the module you create instead of BladeManager. The add-in does not check for dependencies; you must register the modules in the correct order.
This exercise also shows how a module routine can call a routine from another module directly by using a wrapper function instead of an SQL statement.