MorphX Concepts

Some central object-oriented mechanisms and terms appear repeatedly as you develop with MorphX. Below is a brief explanation of the most important ones.

MorphX concept

What is it and how does it work?

System class

An interface to the functionality that is defined in MorphX, such as to creating or running a form.

Class

Defines an object's interfaces. A class instructs or explains how to construct an object of a particular type.

An essential characteristic of a class is that you can "new" it. This means that you can create a new instance (an object) of the class.

Forms are an example of a class. MorphX has a class definition that describes exactly what happens when a form object is created.

Controls

A graphical object, such as a text box, a check box, a command button, or a rectangle, that you place on a form or report when you are designing it to display data, perform an action, or make the form or report easier to read.

There are approximately 20 different controls and each is defined by about 50 properties.

Data Source

Holds the data variables that a form or a query uses. These data variables can be one or more tables, or they can be individual fields from tables.

Designs

Provides access to define the layout of a form or a report.

Encapsulation

The data in the system is hidden behind methods and can be changed only by the methods.

Final

A class or method modifier that defines that the class or method cannot be extended (overridden).

Inheritance

A central concept in MorphX. It means that what you define at lower levels in the system is automatically inherited by higher levels.

An illustration of the hierarchy of inheritance is that your own methods can be built on and extend one of the methods defined in MorphX. In the code this is indicated by the super reference.

You can always recognize an inherited method on the down arrow in the methods icon (Aa869749.IdeInheritanceIcon(en-US,AX.10).gif).

Method or object method

Tasks that you can tell an object to do.

Methods can be programmed at several levels:

  • As part of a table

  • As part of a form

Methods for a form can be related to:

  • The general management of the form, such as running the form, or closing it

  • The data displayed in the form, such as deleting, or writing data

  • Form controls, such as moving the cursor

  • As part of queries

  • As part of a general class library

Initially, the methods are only frames that activate the methods of MorphX (indicated by the super() call).

The small icon in the tree structure indicates that there is, as yet, no user code in the methods.

When you have added some code of your own, a small, colored indicator is displayed in the icon. The color bar is green when your code has no syntax errors and red in cases when your method has errors.

In a method you can:

  • Add code to be executed prior to the main action of the method.

  • Write you own method or let MorphX handle it (the super() call).

  • Add code to be executed after the main action of the method.

Object

The central MorphX concept. Any form or control is an object. The database is an object.

Objects are created from classes. An object is an instance of a class.

Objects provide a convenient, logical way to organize procedures and data. Objects are encapsulated, which means that they contain both their code and their data.

To use an object, you must keep a reference to it in an object variable.

Property

Properties are data that describe an object. Each type of object has different types of properties. A method typically has only a few properties, one of which defines where it is to run. Conversely, a control frequently has about 50 properties which define position, size, color, and so on.

Query

A query is a filter mechanism to retrieve the data you want to see from your database tables.

Queries are typically used as the source of records for forms and reports.

Community Additions

ADD
Show: