Deep Bhattacharjee's blog. Deep Space

Sunday Dec 14, 2008

I have a friend who is an software architect in a large Wall Street bank, or lets say, remnants of a large Wall St bank! One of things he mentioned to me a few years back was that whenever their team wanted to deploy a new application the biggest headache was finding the power to deploy additional hardware in the already power saturated data-center. 

These days there is a lot of talk about private clouds. Some companies (a lot of them are start ups) are building cloud solutions for the datacenter. There are a lot of hurdles in the path of these companies. Lets look at a few:

1. What happens to the volumes of code that already exist in that datacenter? Is there a migration path for these applications to use the private cloud's RESTful or other APIs? One can easily imagine that all new applications can be written using the cloud APIs. However, given the current economic situation and the oft used mantra "if it ain't broken, don't fix it" it would be really hard for existing applications to be ported to a cloud model. The best that could happen is that these applications run on virtualized resources which may already be happening.

2. What happens to the existing service delivery model? The customer service, the ticketing system to the fix hardward, software problems, etc. are all based on the traditional model of the datacenter. All of this wold need to be overhauled when the datacenter becomes a private cloud.

3. The management software to manage existing datacenters is something companies have invested quite heavily in. They have also trained their man power to use these enterprise management software. Either the private cloud is able to work with these management applications or else the switching costs will be very high.

All of this will dissuade existing data centers from switching over so easily. The private cloud provider will need an army of service professionals who can come on board and make the transition smooth for the enterprise customer. That makes me think small companies are not in a position to make  an impact with a private cloud solution. Large companies like Sun Microsystems, IBM, Dell, HP are better positioned to affect such a change.

The other way for private clouds to make a foray is to be able to disrupt the dynamics of a traditional data center. One way might be to have the private cloud support an aggregation of all the services that people are looking for these days: the collaboration tools, the social networking apps, the build/deploy services, etc.  The key is to provide these services in a way that lowers the learning curve.  The other key thing private cloud providers need to do is keep on harping about the improved data center utilization of the new architecture. Also the private cloud APIs need not be private as such. These could be seen as fronting public cloud providers too. That way when the data center does run out of hardware resources some applications could use public clouds without the applications being affected in any way. Applications  that don't need to run in-house from a security/privacy point of view can be outsourced to the public cloud.

Bottom line, private clouds are viable but only for new applications. Existing applications can move to a private cloud one application at a time. Its like the early days of the web when IBM deftly coined the term "e-business" when all it did was move Mainframe applications to the web one at a time. In the process they sold lots of mid sized Unix Servers and huge service contracts.

Tuesday Jan 15, 2008

This example shows the usage of the Visual Web Pack (VWP) module of Netbeans to design a simple application that finds and displays locations using Google's Map and Geocoder API. Google API's are used on the client side. The VWP module makes use of the Woodstock components for display. A step by step process is described below.

a) Design the page layout using the VWP design surface. I left some space on the left for the map to be displayed. The rest of the page consists of simple Woodstock components like textField, staticText, hyperlink etc. Because of the way Google Maps work the corresponding JSP page has an iFrame which includes the required Google Map Javascripts. The image below shows the layout of the page on the design surface.

 Design surface layout

Once done with the basic layout of the page I included the following iframe to the JSP page:

<div id="map_canvas" style="height: 480px; width: 600px"></div>
<webuijsf:markup>
       <iframe id="iframe1" name="iframe1" src="iFrame1.html" style="width:400px; height:300px; border:none;  
        overflow:hidden;"></iframe>

</webuijsf:markup>

Note that once you add this image the page may not be visible on the design surface anymore! I also added the following Javascript in the page:

 
                    <script text="javascript">
               function setValue(address, lat, lng) {
                 var widget1 = dijit.byId('form1:staticText3');
                 widget1.setProps({value: "Latitude: " + lat + " Longitude: " + lng});
                 var widget2 = dijit.byId('form1:staticText4');
                 widget2.setProps({value: address});
               }
               

               function show() {
                  var widget1 = dijit.byId("form1:textField1");
                  var widget2 = dijit.byId("form1:textField2");
                  var widget3 = dijit.byId("form1:textField3");
                  var widget4 = dijit.byId("form1:textField4");
                  window.frames['iframe1'].showLocation(widget1.getProps().value,
                     widget2.getProps().value, widget3.getProps().value,
                     widget4.getProps().value);
                  return false;
               }
                      
               function find() {
                  var widget1 = dijit.byId("form1:textField1");
                  var widget2 = dijit.byId("form1:textField2");
                  var widget3 = dijit.byId("form1:textField3");
                  var widget4 = dijit.byId("form1:textField4");
                  window.frames['iframe1'].findLocation(widget1.getProps().value,
                  widget2.getProps().value, widget3.getProps().value,
                     widget4.getProps().value);
                  return false;
               }
            </script>

The iframe HTML page had some simple HTML and Google Maps related Javascript. The final JSP page can be found here.  The image below shows a running example.

example image
The application is available as a netbeans project. You can download, unzip it and load it as a Netbeans app.


Thursday Feb 22, 2007

There have been questions around what causes the tree nodes to expand/collapse. Tree nodes that have children will expand or collapse when the handler icon to the left of the node is clicked. If the tree node component is supplied node text and node image via attributes (text and imageUrl respectively) then clicking on the text or the image associated with a non child node will cause the node to expand collapse. This is shown by the code segment in bold below. If one were to run the example shown below clicking on the "Google" image link will cause the node to expand/collapse. For the other tree nodes where facets have been used this behavior will not be exhibited.

<table width="100%">
<tr valign="top"><td>
<!-- Tree Example 1... -->
<webuijsf:tree style="width:30em;"
    id="TreeExample1"  expandOnSelect="true"
    text="Client-side Tree" url="#"
    clientSide="true">       
    <f:facet name="image">
        <webuijsf:image id="image"
        icon="TREE_FOLDER_ALARM_CRITICAL" />
    </f:facet>
    <webuijsf:treeNode id="node0" expanded="true"
       text="Node with action as Constant MB" 
       actionExpression="hyperlinkPage">
       <f:facet name="image">
         <webuijsf:image id="image" icon="TREE_FOLDER_ALARM_CRITICAL" />
       </f:facet>
           

       <webuijsf:treeNode id="node1" expanded="true"
          text="Node with action as MB"   
          actionExpression="#{BackingBean.success}">
          <f:facet name="image">
            <webuijsf:image id="image"
               icon="TREE_FOLDER_ALARM_CRITICAL" />
          </f:facet>
          <webuijsf:treeNode id="node1_1" text="Kenga">
              <f:facet name="image">
                <webuijsf:image id="image" icon="TREE_SERVER" />
              </f:facet>
           </webuijsf:treeNode>


           <webuijsf:treeNode id="node1_2"
                text="Node with a URL" url="../index.jsp">
                <f:facet name="image">
                <webuijsf:image id="image" icon="TREE_SERVER_CRITICAL" />
                </f:facet>
            </webuijsf:treeNode>          
       </webuijsf:treeNode>

       <webuijsf:treeNode id="node2" imageURL="/images/google.jpg"
             text="Building 10" url="#">

           <webuijsf:treeNode id="node1_2" text="Skippy" url="#">
              <f:facet name="image">
                <webuijsf:image id="image" icon="TREE_SERVER" />
              </f:facet>
           </webuijsf:treeNode>
       </webuijsf:treeNode>
    </webuijsf:treeNode>
    

    <webuijsf:treeNode id="node3" expanded="true" text="Building 2" url="#">
        <f:facet name="image">
          <webuijsf:image id="image" icon="TREE_FOLDER" />
        </f:facet>
        <webuijsf:treeNode id="node3_1" text="Arizona" url="#">
          <f:facet name="image">
             <webuijsf:image id="image" icon="TREE_SERVER" />
          </f:facet>
        </webuijsf:treeNode>
    </webuijsf:treeNode>
    

    <webuijsf:treeNode id="node4" text="Building 3" url="#">
       <f:facet name="image">
          <webuijsf:image id="image" icon="TREE_FOLDER" />
       </f:facet>
       <webuijsf:treeNode id="node4_1" text="Tundra" url="#">
          <f:facet name="image">
             <webuijsf:image id="image" icon="TREE_SERVER" />
          </f:facet>
        </webuijsf:treeNode>
    </webuijsf:treeNode>
    

    <webuijsf:treeNode id="node5" expanded="true" text="Building 4" url="#">
        <f:facet name="image">
          <webuijsf:image id="image" icon="TREE_FOLDER_ALARM_MAJOR" />
        </f:facet>
        <webuijsf:treeNode id="node5_1" text="Neptune" url="#">
           <f:facet name="image">
             <webuijsf:image id="image" icon="TREE_STORAGE_MAJOR" />
           </f:facet>
           </webuijsf:treeNode>
             <webuijsf:treeNode id="node5_2" text="Zeus" url="#">
             <f:facet name="image">
                <webuijsf:image id="image" icon="TREE_STORAGE" />
             </f:facet>
           </webuijsf:treeNode>
        </webuijsf:treeNode>
</webuijsf:tree>
<!-- End Tree Example -->
</td></tr></table>

 

 

Friday Feb 16, 2007

Almost a year after I created this space I have decided to actually write something. What better way to start than by announcing the fact that the project I work for has gone open source. I am taking about Project Woodstock - an effort within Sun to come up with a set of User Interface components, some of which are rather complex, that are needed in most web applications. Visit Project WoodStock in dev.java.net and check it out. You can also find references to it from the Aquarium .

                                                  Poster for Original Woodstock
 

In order to use these UI components you need to be familiar with JSF. You would also need a compliant application Server to run these components. You could download Sun's flagship Application Server for free. Visit project Glassfish to download.