Chapter 4 Using PowerDynamo with Jaguar


Jaguar and PowerDynamo architecture

The following diagram demonstrates one scenario in which a Dynamo client connects to Jaguar in order to process a Dynamo script, which contains a MASP call to a Jaguar component.


Steps These steps correspond to the numbers in the diagram:

  1. A browser requests a Web page. The Web page is a Dynamo script that contains HTML, SQL queries and a MASP call to a Jaguar component in that order.

  2. The Web server passes the request to Dynamo.

  3. The script is retrieved from the Web site (not shown in the diagram). Processing of the script begins. The HTML and SQL query within the Dynamo script is processed.

  4. An ODBC or Open Client connection is made to a database to retrieve the necessary information for the SQL query.

  5. The data is returned to Dynamo. Processing of the script continues until the Jaguar component call is encountered.

  6. Because a MASP call is being made, an ODBC or Open Client connection is made to access the Jaguar component and the called method.

  7. The component method is executed. If the method requires database access, a connection is made to a database to retrieve the appropriate data.

  8. The data is returned to Jaguar through an ODBC, Open Client, or JDBC connection.

  9. The results from the Jaguar function are returned to Dynamo through an ODBC or Open Client connection.

  10. Dynamo passes the results, in HTML format, back to the Web Server.

  11. The results are passed back to the client through an HTTP connection.


Notes

A Web author can imbed calls to Jaguar components within a Dynamo script or template. The Dynamo script will execute in the regular manner until it encounters the call to the Jaguar component. At this point, a connection (through Dynamo) will be made to the Jaguar server, the appropriate method will be executed, and the results will be returned to Dynamo. Dynamo processes the information and returns pure HTML to the client.

Calling Jaguar components from Dynamo scripts

You can call Jaguar components from within a Dynamo script by using:

The SQL tag, COMPONENT tag, and the connection.CreateQuery and connection.CreateComponent methods allow Dynamo to call Jaguar components as though they were Methods As Stored Procedures (MASP). Each MASP invocation creates an instance of the component, invokes the method and then destroys the component instance. The COMPONENT tag can also be used to access ActiveX and Java objects--however, just as with MASP, each invocation creates an instance of the component, invokes the method and then destroys the component instance. The Dynamo CreateObject method allows the user to create an instance of an ActiveX object and access its methods and properties from within a script. The ActiveX object exists until it goes out of scope or until the ActiveX variable is assigned a new value. The Dynamo java.CreateComponent method allows the user to create an instance of a Java object and access its methods and properties from within a script. The Java object exists until it goes out of scope.

Using MASP verses ActiveX and Java

Within an application there are a few benefits to creating an instance of an ActiveX (using the CreateObject method) or Java object (using the java.CreateComponent method) against a Jaguar component instead of making a MASP method call:

If a script requires repeated use of a Jaguar component, the creation of an ActiveX object or Java stub is the preferred method of working with a Jaguar component and its methods. ActiveX, however, is a Microsoft technology, which means that it is available only on Microsoft operating systems. Java, on the other hand, is platform-independent, which means that Java objects can run anywhere. For a detailed explanation of MASP, see the Jaguar CTS Programmer's Guide.

 


Copyright © 2000 Sybase, Inc. All rights reserved.