Sunday, February 23, 2014

Performance Tip for Webcenter - IDs of Container components

Tip - ADF has a concept of container components by which its child components will have unique ids when rendered as HTML in front end.

Eg :  Lets say Region 1 and Region 2 form a part of a same page.
If Region 1 is with id r1 have an input text component with id i1
and Region 2 is with id r2 have an input text component with id i1
The ids of  input components in the rendered HTML would be r1:i1 and r2:i1

So though the input text component's ids are same, unique value is assigned to them automatically when the UI tree is formed during ADF lifecycle 
cool right??

Lets see a con about this, Since all of the child component's id will be appended by the parent component's id in the front and lets say you have have inputTextComponent in the below location


now the id of InputText in the front end would be (assuming ids given for each container as below)


This would add up to the HTML size loaded in front end.

Lets see the impact with a real example - I do have a simple page with a af:table and i have given the Table ID with a neat name "TableOne".

Now lets change the  Table ID from "TableOne" to "T"

So just by renaming one container component 0.1 KB is saved, In a large scale application where there are multiple containers and child components are in a single page this would be effective to a good extent.

Always try to name your ids to a much smaller value as possible.

For your reference PFB the list of container components  -















Saturday, February 15, 2014

Cache in Iterator binding

This post is about the "CACHE" attribute in Iterator bindings. Though it looks very simple to turn on/off cache in iterator it has lot of implications with respect to performance, so just wan't to highlight it with an example :-)

Employee-Department view link of HR schema is used here.

Step 1 - I have generated java class for EmployeeVO and Departments VO with custom data source methods, placed sysouts in executeQueryForCollection.

Step 2 -  Drag and drop the view link as master detail table, run the application and observe the sysouts-

Here department VO's query is executed once on page load and employee VO query is executed as we select each department. This sounds fair right? Let turn of the Cache in iterator and try again.

Step 3- Re run the app again and now you could able to notice that DepartmentsVO gets executed on page load and as well on every PPR. Look at the number of EmployeeVO queries for each PPR !!

Proves to be an important factor :-)

How to run pubsub server in Integrated weblogic server

Scenario - For one of the usecase I had to do couple of POC on pubsub server, and as always its better to start of with Integrated WLS. I was following this wonderful blog from james bayer -
Real-time Updates on WebPages - Part 2 - Hello World Comet Application

Problem - Integrated server does not come packaged with pubsub.war :-(

Solution - 

Step 1 -  Locate pubsub.war in <MiddlewareHome>\wlserver_10.3\common\deployable-libraries\pubsub-1.0.war of weblogic server

Step 2 - Install it as a shared library in your integrated weblogic server.

Step 3 -  Now though we installed pubsub all it's dependent libraries are still not available in IntegratedWLS so we need to open the pubsub.war using winzip/anything available and see its dependent libraries in MANIFEST.MF,  then copy those libraries from Weblogic server location to Integrated WLS server location. Now that will take quite some time.

Let me give you another short cut- Copy all the folder contents from <MiddlewareHome>\modules\features and jars from  <MiddlewareHome>\modules\ to the same location in Integrated WLS.

This step copies all the required libraries to run pubsub.

So thats pretty much it :-) you can run pubsub locally :-)

Note - I used weblogic 10.3.6