Progress
Open Client
Developer’s Guide


AppObjects

Each AppObject represents the encapsulation of some set of business logic deployed at a particular AppServer and it establishes a connection to that AppServer.

Methods

An AppObject has the following types of methods:

Example Java AppObject

Example 4–1 shows a partial sample Java class definition for an AppObject, Account. This proxy contains Remote 4GL methods to run Add.p and Remove.p, and a Class Factory method that runs AccountInfo.p persistently on the AppServer.

Java AppObject
public class Account
{
  // -------------------------Constructors--------------------------------
  // Connects to an Application Service using a NameServer and  
  // Application Broker or directly to an AppServer.

  public Account(String url, String userId, String password, String
         appServerInfo) throws ConnectException, SystemErrorException {}
  public Account(String userId, String password, String
         appServerInfo) throws ConnectException, SystemErrorException {}
  public Account() throws ConnectException, SystemErrorException {}

  // ------------------------Remote 4GL Methods---------------------------

  public void Add(int accountNum, String name) {} // runs Add.p
  public void Remove(int accountNum) {}          // runs Remove.p

  // ------------------SubAppObject Class Factory Methods-----------------

  public Tax createAO_Tax() throws Open4GLException, NotRunException,
         RunTime4GLException, SystemErrorException {}

  // -------------------ProcObject Class Factory Methods------------------

  public AccountInfo createPO_AccountInfo (int accountNum)
         throws Open4GLException, NotRunException, RunTime4GLException,
         SystemErrorException  {}  // runs AccountInfo.p persistently

  public SDOResultSet _createSDOResultSet(String procName)
         throws Open4GLException, ProSQLException {}
  public SDOResultSet _createSDOResultSet(String procName, 
         String whereClause, String sortBy)
         throws Open4GLException, ProSQLException {}
  public SDOResultSet _createSDOResultSet(String procName, 
         String whereClause, String sortBy, SDOPameters params)
         throws Open4GLException, ProSQLException {}

  // --------------------------Common Methods-----------------------------

  public void _cancelAllRequests() throws Open4GLException {}
  public String _getConnectionId() throws Open4GLException {}
  public String _getProcReturnString() {}
  public boolean _isStreaming() throws Open4GLException {}
  public void _release() {}
} 

Example 4–1: Java Account Class

For more information on how to specify the parameters for the AppObject constructors for a particular AppServer connection, see the "Connecting To a Progress AppServer" section in this chapter and in Programming Java Clients." For more information on the other types of methods, see the "Understanding Proxy Object Methods" section in this chapter.

Example ActiveX AppObject

The following Visual Basic subroutines and functions comprise the definition for a sample ActiveX AppObject, Account, where each method appears as it is displayed by the VB Object Browser as AccountLib.CAccount:

For more information on how to specify the parameters for the connection method, OC_Connect(), for a particular AppServer connection, see the "Connecting To a Progress AppServer" section in this chapter and in Programming ActiveX Controller Clients." For more information on the other types of methods, see the "Understanding Proxy Object Methods" section in this chapter.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095