Class Structure

The ITRDS is a COM object which when created exposes an object model for you to use. Because the ITRDS uses OOP Visual FoxPro programming, the object model utilises Classes and parent classes.

What are Classes

This is a huge topic which you can find many resources about on the NET. However I will try and summarise it here.

In short, classes are like boxes of programming code. Once I have created a Class, I can make new classes based on this "Parent" class. However because I am basing my new class on an existing one, it automatically inherits the Methods and properties of the "Parent" class. Thus allowing huge savings on programming code as it inherits all the code form the parent class.

For example say I create a class called CLASSA which has properties A and B. Then I create a class called CLASSB based on CLASSA, hence CLASSA is the parent class of CLASSB. Then CLASSB will automatically inherit properties A and B. Then, if I want, I can add property C to CLASSB due to the nature of the use of CLASSB. Then CLASSB will have properties A, B and C.

What does this mean in relation to the ITRDS?

Well RP_CLIENT is the main class you create. This class has properties such as oCustomers, oWorkOrders etc. These properties that start with 'o' are in fact objects (classes). Say we were to look at the property oCustomers. We would see that it is based on the class RP_CUSTOMERS whose parent class is RP_DATA. Hence the property oCustomers has all the properties and methods of the class RP_DATA PLUS any properties and methods which are specific to the class RP_CUSTOMERS.

Explaining this Again but with Pictures

When you create the object using the command such as;

loITRDS = CreateObject("ITRDS.RP_CLIENT")

what you are doing is creating an object based on the class RP_CLIENT and assigning it to the variable loITRDS. Hence in essence, loITRDS is the class RP_CLIENT.

The basic object model to the ITRDS as follows;

RP_CLIENT

This is the main object that you create. It is in essence the ITRDS object just given the name RP_CLIENT. Once you create this object all other objects are automatically created, initialised and attached to properties of this object. To view all the attached properties and objects available to you all you need to do is click on the RP_CLIENT node under this node (RP_CLIENT).

What this tells you is that once you create your object with a command something like;

loITRDS = CreateObject("ITRDS.RP_CLIENT")

then all these methods and properties are now attached to loITRDS. For example there will now be a property of loITRDS.oCustomers. This is the object you use to access data from the CUSTOMERS table.

Similarly there is a property loITRDS.oWorkOrders which is the object you use to access data from the WORKORDR table and so on. It also shows you the methods that are available such as "SetSystem"

If we go back to the property oCustomers you will need to know how to find out what methods and properties you can access on this property (which is itself another object). To do this just click on that property and you will see the following;

What this is telling you is that the property oCustomers is based on the class RP_CUSTOMERS. Hence you will need to look at that class to get the information you are after. You can get there by simply clicking on the hyperlink to it. When you do this you get the folllowing;

This is where you need to start understanding about parent classes. This page is telling you that the parent class of RP_CUSTOMERS is RP_DATA. What this means is that the methods and properties that are available to you in RP_CUSTOMERS are all those in RP_DATA plus any specified here in RP_CUSTOMERS.

Hence to summarise. If you want to know what methods are available on the object;

loITRDS.oCustomers it will be the following;

Methods and properties of RP_CUSTOMERS PLUS methods and properties of RP_DATA (the parent class of RP_CUSTOMERS)

RP_DATA
This is the parent class of all the table business objects. Such as oCustomers etc.

Table business objects are what allow you to talk to the tables in Rams. There is one Table Business Object for each table that is dealt with specifically by the ITRDS along with a general "Read Only" Table Business Object called "oTable" which you can configure yourself to read data from nearly any table in the Rams system.

Below the RP_DATA class you will notice a node for each of the Table Business Objects. For example the RP_CUSTOMER class. When you click on the RP_CUSTOMER node you will see the following

What with tells you is the following

  • The Parent class is "RP_DATA". This means that this class, RP_CSUTOMERS (assigned to property RP_CLIENT::oCustomers) has all the methods and properties of the class "RP_DATA". To see all these properties simply click on the highlighted text of "RP_DATA".

  • In addition to all the methods and properties of RP_DATA it is also showing us that there is an additional method called "isvalidaccount" which is specific to this class.



  • Last Updated: 23/11/2005