User's Guide

Creating the classes

To create this data type, you will need two classes: the Smalltalk data type and the VisualAge data converter. The Smalltalk data type represents the province data type itself. The data converter class makes the province data type available to VisualAge parts. These classes work together to validate input from users or other sources.

For the prime number data type, you only created one class, which was the data converter class. This is because the prime number used a predefined Smalltalk class as its data type. But because Smalltalk doesn't have any class that represents a province, you must create a new one.

Defining the Smalltalk data type

First, create a new nonvisual part named MyCanadianProvince that inherits from Object in your runtime application.

Defining the data type converter

Now create a new nonvisual part named MyCanadianProvinceConverter that inherits from AbtConverter in your runtime application.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]