Skip to main content

New Class Wizard

New Class Wizard

To open the New Class wizard, select File > New > General and select Class Definition.

The New Class wizard prompts you for information. Select Finish at any time (in this case, default values are provided for any information you have not specified).

Name and Description Page

The New Class wizard prompts you for the following information (with the exception of class and package name, you can later modify any of these values):

Package Name

Package to which the new class belongs. You can select an existing package name or enter a new name. If you enter a new name, the new package is automatically created when you save your class definition. The only punctuation marks that property names can contain are a dot (.) and a leading percent sign (%).

For more information on packages, see Package Options.

Class Name

Name of your new class. This must be a valid class name and must not conflict with the name of a previously defined class. Note that you cannot change this class name later.

See Rules and Guidelines for Identifiers.

Description

(optional) Description of the new class. This description is used when the class' documentation is displayed in the online class library documentation.

A description may include HTML formatting tags. See Creating Class Documentation in Defining and Using Classes.

Class Type Page

The New Class wizard asks you what type of class you would like to create. You can either extend (inherit from) a previously defined class or create a new class by selecting one of the following options:

Persistent

Create a definition for a persistent class. Persistent objects can be stored in the database.

Serial

Create a definition for a serial class. Serial objects can be embedded in persistent objects to create complex data types such as addresses.

Registered

Create a definition for a registered class. Registered objects are not stored in the database.

Abstract

Create a definition for an abstract class with no superclass.

Datatype

Create a definition for a data type class. A data type class is used to create user-defined data types.

CSP (used to process HTTP events)

Create a definition for a %CSP.PageOpens in a new tab class. A CSP class is used to create a CSP event handling class. This is a programmatic way to create CSP Pages or to respond to HTTP events (for example, to create an XML server). Using CSP files with InterSystems IRIS is not recommended.

Extends

Extend an existing class: check Extends and enter (or choose from a list) the name of an existing superclass.

Data Type Class Characteristics Page

If you are creating a new data type class, the New Class wizard prompts for certain items particular to data type classes. These include:

Client Data Type

The data type used by clients to represent this data enter a client application.

ODBC Data Type

The data type used by ODBC or JDBC to represent this data type. Choose a type that corresponds to how you want this data type to appear to ODBC/JDBC based applications.

SQL Category

The SQL Category used by the InterSystems SQL Engine when it performs logical operations on this data type.

Persistent, Serial, Registered Class Characteristics Page

If you are creating a new persistent, serial, or registered class, the New Class wizard prompts for certain items particular to persistent or serial classes. These include:

Owner

(optional) For a persistent class, enter the SQL username to be the owner of the new class. This username controls privileges when this class is used via SQL. If this field is left blank, then the default owner, _system, is used.

SQL Table Name

(optional) For a persistent class, enter a name to be used for the SQL table that corresponds to this class. If this field is left blank, then the SQL table name is identical to the class name. If the class name is not a valid SQL identifier, you must enter an SQL table name here.

XML Enabled

(optional) If selected, the class is XML-enabled; that is, it has the ability to project itself as an XML document. It can also be used in Web Service methods. This is equivalent to adding the %XML.AdaptorOpens in a new tab class to the class' superclass list.

For more information see Using XML Tools as well as Creating Web Services and Web Clients.

Zen DataModel

This feature is not supported in InterSystems IRIS.

Data Population

(optional) If you select this option, your new class supports automatic data population. This is equivalent to adding the %Library.PopulateOpens in a new tab class to the class' superclass list.

Automatic data population allows you to easily create random data with which you can test the operation of your class. To populate a class, compile it and then execute the class' Populate method (inherited from the %Library.PopulateOpens in a new tab class). For example, using the Terminal:

 Do ##class(MyApp.Person).Populate(100)

For more information see InterSystems IRIS Data Population Utility.

CSP Class Characteristics Page

If you are creating a new CSP class, the New Class wizard prompts for the following value:

Content Type

Specifies what the content type served by this CSP class is. The available options are HTML or XML. This option is used to set the value of the CONTENTTYPE parameter of the new class to text/html or text/xml respectively. You can later change this to whatever value you want.

Using CSP files with InterSystems IRIS is not recommended.

FeedbackOpens in a new tab