June 2007
Monthly Archive
Fri 29 Jun 2007
Posted by manishn under
JavaNo Comments
Today, I successfully created a Flex Data Grid, using nothing but Java! It took me a while to get all the pieces working together however it finally works and allows me to evaluate Jseamless as a potential option for my Web 2.0 Projects. In order to do this yourself, you need:
- Jseamless.jar
- Jseamless-flex.jar
- Jseamlessx.jar
These can be obtained from www.jseamless.org - you may need latest build or you may need to build from jseamless svn repository.
My sample code is using a StoreProductManager service class which uses StoreProductDAO to query database. You can use an array or any other simpler implementation. It was frustrating to say the least, to get to this point however, now that I am here, I can move on to doing more advanced works such as creating Flex Forms, using nothing but Java (Powered by JSeamless, ofcourse).
See code: ProductBrowser.java, StoreProductManager.java
Thu 28 Jun 2007
Posted by manishn under
GeneralNo Comments
Nearly 8,600 voters have voiced their choice, and the 2007 inductees are ExxonMobil, Halliburton and Wal-Mart. You can read for yourself here. Some of my favorite comments are about ExxonMobil. Read below:
Exxon is gouging America with unreasonably high fuel prices while spending millions to prevent better fuel efficiency. Austin, TX
Exxon, you need to face the music and pay for the damages your oil spill caused. Much life was lost and the damage is still there. St. Charles, MO
Exxon, for its flagrant destruction of environment and greedy avoidance of its responsibility. Seattle, WA
Exxon has spent huge amounts of money to confuse ordinary people and governments into inaction, through funding of climate change skeptics. If Exxon had used the money it wasted on funding skeptics to clean up its act, the world would be well on the way to reducing global greenhouse gases now. Alberta, Canada
Being from Louisiana, I know all too well how Exxon has weaseled its way into local communities, does as little as possible even if it means compromising worker safety, and release of chemicals due. They have record profits and are eliminating jobs that are vital to the safety of their refineries. Greenwell Springs, LA
Exxon endlessly appeals the court decisions that find them culpable for the 1989 oil spill some of the defendants have died while Exxon’s phalanx of lawyers refuses to take responsibility for their disaster. Fairbanks, AK
Exxon wins hands down for causing the greatest potential harm to the most people. Their actions, if unabated, will contribute directly to the extinction of thousands of species and perhaps billions of people as weather patterns shift, seas rise, deserts encroach upon farmland and habitat is lost through global warming. Atlanta, GA
Sat 23 Jun 2007
Posted by manishn under
GeneralNo Comments
Employing a combination of mind-blowing special effects and new and declassified footage, Nuclear Rescue 911 is the true story of America’s nuclear weapons program, and the accidents which are likely to occur when such a massive amount of artillery is tested and stored. Six nuclear devices have been lost and never recovered since 1950, and this film discusses the repercussions of such accidents.
I watched this documentary recently and I must say, it was enlightening. Visit Netflixto see it for yourself.
So what is a Broken Arrow?

A nuclear weapon accident, incident, or deficiency (AID) is a condition which degrades nuclear surety/safety. This includes damage, loss, destruction, malfunction, or exposure to adverse weather conditions of any part of the weapon system. The classifications of accidents, incidents, and deficiencies are described below.
BROKEN ARROW
A nuclear weapon system accident - an unexpected event involving a nuclear weapon, warhead, or nuclear component resulting in destruction of a nuclear weapon, radioactive contamination, or a hazard to the public either actual or implied, such as nuclear or non-nuclear detonation of a weapon.
BENT SPEAR
A nuclear weapon system incident - significant incident or unexpected event involving a nuclear weapon, warhead, or nuclear component resulting in damage to the extent that major rework, examination, recertification, or complete replacement by the design agency is required. An incident requiring immediate action in the interest of safety or nuclear weapons security which may result in adverse national or international public reaction.
NUCFLASH
An accidental or unauthorized launching, firing or use of a nuclear weapon or weapons system by US or non-US supported allied forces which could cause the outbreak of war.
The normal procedures for reporting accidents, incidents, or deficiencies is contained in AFI 91-204. The initial report, usually in message format, is also contained in AFI 91-204.
Key flag words:
- DULL SWORD - Deficiency

- BENT SPEAR - Incident
- ROGUE SPEAR - Confirmation that a non governmental agency has a nuclear weapon.
- BROKEN ARROW - Accident
- NUCFLASH - Possible War
Thu 21 Jun 2007
Posted by manishn under
JavaNo Comments
Today, I explained the difference between an entity vs. an association of entities to a colleague of mine. I used Oracle’s JPA tutorial to explain the object model vs. its physical representation in database:

Order Entity contains a collection of Item entities - when this object model is implemented in a database, we might create ITEM and ORDER table to represent Item and Order entity and ORDER_ITEM table to represent the association between these two entities.
Table ORDER_ITEM is an association, not a real Entity. We add or remove Item entity from Order entity. ORDER_ITEM is just a way of representing this association in database.
Thu 21 Jun 2007
Posted by manishn under
Javascript ,
JavaNo Comments
Jseamless (www.jseamless.org) is a user interface abstraction layer for java, quite similar to what AWT or swing but not bound to any specific framework. Jseamless allows developers to create web applications, entirely in java, without requiring HTML, CSS or Javascript knowledge. Further, application can be deployed onto multiple platforms such as OpenGL, Flash (Flex), HTML, Swing or J2ME (Mobile Devices). Idea isn’t new - Openlaszlo (www.openlaszlo.org), Echo2 (www.nextapp.com) have gone there before.
Matthew Hicks (www.matthicks.com) is the lead developer for jseamless and is extreamly responsive in the support forum. I started exploring jseamless recently for a project, with the idea that if all work is done on the java end, end product might be better and well knit, compared to now where:
- Data model is represented by POJO’s
- Data is extracted by DAO’s (JPA + Hibernate as Persistence Provider)
- Business / service layer binds everything together, does validation, applies business logic, processes business events
- DWR (www.getahead.org/dwr) exposes business data and service methods to web as javascript
- Ext JS library (www.extjs.com) is used to create the UI
- Ext JS components such as a Grid use objects of type Ext.data.Record which is a representation of POJO
- Ext JS uses a concept of store, which is a in-memory cache of records
It works great, however:
- UI with 1 main dialog box, 3 sub dialog boxes, 1 main form, 3 sub forms, 5 data grids (No data in any component, yet); It seems to peak cpu usage of my workstation to 100% for about 30 - 45secs at launch. It also takes up quite a bit of memory.
- Translating POJO’s to javascript objects (Ext.data.Record) and back to POJO to finally invoke service calls using DWR is necessary.
To be continued…
Wed 20 Jun 2007
Posted by manishn under
Javascript[2] Comments
I am developing an Ext JS based web application which will manage Origination aspect of commercial loan. Initial prototyping was done using DOJO Framework v0.4, however this version of DOJO is far too slow to be used in Production and version 0.9 is not yet ready for prime time. Ext JS is promising and certainly far better in terms of speed of execution, consistent look and feel and rich collection of widgets. Anyway, the ideas is as follows:
- Main Page: This page will contain a collection of deals, which can be sorted and filtered using various criteria such as: My Deals or Deals that are in a certain status.
- Deal Management Dialog: This dialog is the crux of this application. It is used to create new deals, or to manage existing deals.
I am using JPA (Java Persistence API) to implement the server side code. Hibernate is used as persistence provider. Transaction are RESOURCE_LOCAL (managed by the application) - I have implemented transactions using callback to avoid sprinkling transaction related template code all over the business layer.
-Main View: Calls StatefulRemoteDealManager.findMyDeal() to get a collection of current user’s Deals. StatefulRemoteDealManager is aware of user’s session / context and returns deals created / managed by the current user.
-New Deal View: Calls StatefulRemoteDealManager.createDraftDeal() to create a deal in draft state.
DWR allows to expose fine or coarse grained server side methods to JavaScript using JSON. For example, when I need to create a Borrower, I call, RemoteBorrowerManager.save(Borrower b).
Borrower object can be constructed in javascript as:
var borrower = new Borrower({name: ‘ABC Borrower Inc.’});
Tue 12 Jun 2007
Posted by manishn under
JavascriptNo Comments
It is kinda funny how many of us have been developing web applications for years, yet we never truly realized the power of JavaScript! Sure, we did create functions; some of us even created libraries of functions but that’s about it. Lot of things have changed in the web development space - AJAX is the name of the game and Google is leading the way by creating many successful web based applications that use JavaScript. So, long story short, while creating wireframe of an application, using ExtJS, I learnt a lot about JavaScript Programming.
For instance, I didn’t know that namespaces exist in JavaScript! See here. For that matter, public and private variables, returning public interfaces of your objects, is all fairly common in most other object oriented languages, yet so many of us are simply not aware of such capabilities of JavaScript. Over next few days, I will post my experience of working on ExtJS and integrating it with DWR (Dynamic Web Remoting).
Tue 12 Jun 2007
Posted by manishn under
Thoughts1 Comment
After much procrastination, I have finally decided to set up this blog to share my thoughts. I did do this before but wasn’t diligent enough to maintain it. This time however…