Creating a New Class
Begin by creating the Contact class using the Studio New Class Wizard:
Click File–>New on the Studio menu bar.
On the New dialog, click the General category and then the Caché Class Definition template. Click OK. This launches the New Class Wizard.
On the first page of the New Class Wizard , enter ContactDB for the Package Name and Contact for the Class Name. Click Next.
The Wizard's second page allows you to select the class type. Click Persistent and then click Next.
The Wizard's third page allows you to specify additional characteristics for the class. Click XML Enabled, Zen DataModel, and Data Population. Click Finish.
The Studio Editor displays the newly created class definition:
Notice that Contact extends several classes:
%XML.Adaptor—We chose this when we selected additional characteristics at step 5. Extending %XML.Adaptor allows Contact to be used with Caché's XML tools. For example, we can export Contact instances as XML and use Contact in Web Services scenarios. We will not be using these features in this tutorial.
%ZEN.DataModel.Adaptor—We chose this when we selected additional characteristics at step 5. Extending %ZEN.DataModel.Adaptor allows Contact to interact easily with the ZEN web framework. In particular, it allows us to easily create Zen forms for creating and updating Contact instances.