Académique Documents
Professionnel Documents
Culture Documents
The information contained in this document is confidential to GFT Iberia Solutions S.A.. The
document may not be disclosed, duplicated, or used, for any purpose, in whole or in part,
without the prior written consent of GFT Iberia Solutions S.A.
Disclaimer
Hard copies of this document which have not been authorised and included on a distribution list
are FOR INFORMATION ONLY, AND ARE NOT SUBJECT TO DOCUMENT CONTROL, WITH
NO FOLLOWING REVISIONS.
Document status.
Date of Issue:
File name:
www.gft-iberia.com 2 / 11
Tibco GI–Best Practices
Table of content
Purpose...............................................................................................................4
1 Scope................................................................................................................4
2 References........................................................................................................4
3 Application Design..........................................................................................4
4 UI Components................................................................................................6
6 JavaScript Code...............................................................................................7
9 Gzip compression..........................................................................................10
www.gft-iberia.com 3 / 11
Tibco GI–Best Practices
Purpose
The purpose of this document is to serve as a best practices & a guideline for developers who
want to develop rich web applications using TIBCO GI as per bank’s brand portal guidelines.
1 Scope
The scope of the document is to list the various best practices for optimizing Tibco GI
application performance.
2 References
Video demo from Tibco GI site to Optimize Application
http://media.tibco.com/gi/tutorials/6_optimize/6_optimize.html
3 Application Design
One of the critical phases of software design is application design. When designing your
application, it’s important to consider the following:
• What are the end-user requirements?
• What tasks will the user need to accomplish?
• What is the work flow?
• How easy is the application to use?
Application design includes application architecture, user interface design, and component
design. If this phase of application development is neglected, usability and performance can be
adversely affected. For example, poor performance can occur if the application has a poorly
designed, complicated user interface and if the application uses components that aren’t
designed properly. While designing your General Interface application, consider the following
best practices which are in this document.
• Load only those areas of the application that are viewable by the user and required for
the user to begin using the application. For example, load the tab content for the first
visible tab and load content of other tabs only when the user selects the tab.
e.g. In this sample we have 3 tabs and each tab has reference to separate xml
component file.
www.gft-iberia.com 4 / 11
Tibco GI–Best Practices
• Load XML data asynchronously. In the properties editor specify the xml file relative path
in XML URL and select XML Async = Asynchronous.
e.g.
www.gft-iberia.com 5 / 11
Tibco GI–Best Practices
Storing data in form elements, which is a typical HTML pattern, is not recommended for General
Interface applications. Instead of hiding and showing form elements to access data, persist data
separately in an XML/CDF document or JavaScript variable.
Note that persisting data as XML is recommended, because memory management for XML is
better than for JavaScript objects. Once data is persisted, load and unload components as
needed without losing data. For example, persist login and username data from a dialog and
remove the dialog from the General Interface DOM instead of hiding the dialog.
4 UI Components
Use the following best practices when working with components and component serialization
files.
www.gft-iberia.com 6 / 11
Tibco GI–Best Practices
6 JavaScript Code
Use the following best practices when developing JavaScript code for your
application.
Remove Unused JavaScript Code
Remove unused portions of code to make the JavaScript file smaller, speed up the JavaScript
loading time, and make the code run faster.
7 Web Service
7.1 Rule Mapping
Most times, when processing data returned by web services developers generally would need to
convert it to the CDF document format to loading it into a GI component. For such requirements
generally developers tend to create an initial “raw” CDF document from the web services using
the web service rule mapping & then try to modify it using javascript or transform it to another
www.gft-iberia.com 7 / 11
Tibco GI–Best Practices
CDF document using XSLT. This results in multiple processing of the data finally slowing down
the application.
So we strongly suggest that the developers use the various features of the rule mapping
approach to its fullest to generate the expected “final” CDF document in a single shot & prevent
any further processing of the document again.
e.g. If the developer needs to use some complicated javascript to process the data, he could
directly include this javascript function inside the web service rule mapping itself thus preventing
multiple processing. This can be done via the following steps.
a) Select the item to be processed
b) In the mappings section choose the type as “Script”
c) Call the javascript function as the “Path/Value” & pass the item’s value as an argument to the
function.
d) The item’s value can be obtained by the statement
“CDFCONTEXT,MESSAGENODE.getValue()”
e) The parent CDF Record can be obtained via “CDFRecord”
e.g.
If a in the format “Accountno||Bankname||Location||Dealercode” needs to be split as distinct
CDF attributes of a record the rule mapping for this item will be as below
Type: Script
Path/Value: MyClass.myFunction(CDFCONTEXT,MESSAGENODE.getValue());
Function code:
MyClass.myFunction = function(CDFRecord, str) {
var values = str.split("||");
CDFRecord.setAttribute("jsxid", values[0]);
CDFRecord.setAttribute("jsxbankname", values[1]);
CDFRecord.setAttribute("jsxlocation", values[2]);
CDFRecord.setAttribute("jsxdealercode", values[3]);
};
Use xml bind approach for mapping CDF documents to GUI controls such as CDF GUI
containers, matrix, select boxes, combo boxes etc.
e.g.
a) Use the web service rule mapping approach to store a CDF document into the cache as
below with a unique CACHE_ID say “PROGRAM_LIST”.
SCREEN SHOT
www.gft-iberia.com 8 / 11
Tibco GI–Best Practices
c) Open the Properties Editor of GUI component and map the XML Cache Id as
PROGRAM_LIST.
Select Share Resources = Share, XML Async = Asynchronous and XML Bind = Bound.
By this approach the combo box get updated with the values when ever the web service call is
made for the first time and for the subsequent load of the component the CDF document is
loaded from the cache. This removes over head of calling web service for each time load of the
same component in the same browser.
When multiple web services are being called make sure that the application code does not call
the web services sequentially but the calls are made asynchronously.
www.gft-iberia.com 9 / 11
Tibco GI–Best Practices
9 Gzip compression
The time it takes to transfer an HTTP request and response across the network can be
significantly reduced by decisions made by front-end engineers. It's true that the end-user's
bandwidth speed, Internet service provider, proximity to peering exchange points, etc. are
beyond the control of the development team. But there are other variables that affect response
times. Compression reduces response times by reducing the size of the HTTP response.
Starting with HTTP/1.1, web clients indicate support for compression with the Accept-Encoding
header in the HTTP request.
Accept-Encoding: gzip, deflate
If the web server sees this header in the request, it may compress the response using one of
the methods listed by the client. The web server notifies the web client of this via the Content-
Encoding header in the response.
Content-Encoding: gzip
Gzipping generally reduces the response size by about 70%. Approximately 90% of today's
Internet traffic travels through browsers that claim to support gzip. If you use Apache, the
module configuring gzip depends on your version: Apache 1.3 uses mod_gzip while Apache 2.x
uses mod_deflate.
www.gft-iberia.com 10 / 11
Tibco GI–Best Practices
www.gft-iberia.com 11 / 11