Friday, December 21, 2007

Year.introspect(2007)

Being a Friday afternoon, I wanted to finish any pending tasks and go home early and more importantly to keep myself away from the laptop on the weekend. I started looking at the TODO list and the one with top priority was submitting the self assessment. Hmmm, another year just rolled by and while filling up my assessment I introspected my personal life as well.

This year has been very eventful on the personal and work fronts. On the personal front, the long pending tasks have been completed. I purchased my first car, am delighted to drive it. Got a very good deal and purchased a house, would me moving into that very soon and most important, got engaged. The horoscopes have finally relented and I found my soul mate. My fiancee is also a java developer :-).

On the work front, I got a very challenging assignment and am all the more happy for it, though it is going to be little hectic. We will be driving the "Bus" - Enterprise Service Bus. ALSB has been choosen as the ESB and hopefully, the ride is going to be fun and thrilling as we become more SOAified ( I coined this word, hehe).

This year went by just like that, but was very eventful. Hoping that the next year would be more fun filled and exuberant. Wish you all a very Happy and Prosperous New Year, 2008!!!

Monday, December 03, 2007

Safely Remove Hardware icon, where has it gone?

I noticed that sometimes, the "Safely Remove Hardware icon" disappears from the taskbar and simply unplugging the thumb drive has corrupted it once. Today, I found that there is another workaround for this - Start > Run and key in the following to bring up Safely Remove Hardware dialog:

RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

Thursday, November 29, 2007

Open Source Softwares to look at

For some reason, few (great) open source softwares have missed my eye. I'm greatful to my friend who pointed me to these products - JScience, icu4j and Joda Time. How much time I spent grappling with the currency conversions, i18n, l10n and dealing with the date/timestamp issues. I should have known these libraries earlier.Tch!

Wednesday, October 24, 2007

Free the Left Lane

The traffic in Hyderabad is getting miserable everyday. Last year, during the month of October it used to take me approximately 45 minutes to reach office from my home which is 25 KM away. Now it takes anything between 1 hour 15 minutes to 1 hour 30 minutes. Terrible, isn't it! The reason is not just increase in the number of vehicles on the road, but people driving without traffic sense and mutual respect for the others on the road.

There is a concept of free left lane at the signals in Hyderabad, this is not the case in Bangalore. The drivers in a hurry to reach the destination faster block the left lane and cause a severe congestion at the junctions. One such place is the junction at the Cyber Towers where people take a left turn as most of the companies are located on that way.

Recently, few companies started the initiative of "Free the left lane", where in employess of these companies help in freeing the left lane and reduce congestion. These people stand in the hot sun and ensure lane discipline. Thanks, folks! You are helping me reach the office early by atleast 20 minutes. I have noticed employees of SumTotal and CSC, many thanks to you!

Monday, October 15, 2007

SQL Joins

Here is a nice post on SQL Joins. A good read to brush your fundamentals. Don't miss out the links to other posts on this blog entry. Thanks, Jeff for this post.

Wednesday, October 03, 2007

Code for Testability

These days I'm finding it very difficult to get people write the unit tests. The difficulty is even more with the experienced developers, atleast the junior developers are clear when they start writing code and ask questions if they are not clear about something. One funny incident - one of the senior developers completed the coding and asked a junior developer to write the test cases for it. God! The test cases are not just for the sake of it.

Ironically, a few senior developers look at unit tests as some kind of validations!! perhaps due to the use of assert* methods...

Wake up folks!

Thursday, September 20, 2007

Imperatives for setting a goal

What are the factors you'd consider before setting a goal for yourself or for the people who work for you? Apparantly, the answers would be purpose, time frame, execution plan. If these are your answers, you are close but not perfect.

An axiom for setting a goal is RUN which stands for Realistic, Understandable, and Necessary. This sounds very simple and is very elusive and we often overlook it. The explanation for RUN starts with the last character..OK..OK alphabet, I'm engrossed in Software, as always :-). A goal is marked as necessary if it has a purpose/value, is time boxed. Next is Understandable, ensure that the purpose is clearly understood and your or your team's role is clear so that the execution plan is drafted accordingly. Finally, the goal would be realistic if it has well drafted execution plan.

RUN concept is not just limited to software projects. Infact, the concept has been borrowed from the manufacturing domain. Managers, if you want your teams to gain velocity and run, do not forget to apply the RUN concept when you do the estimations next time.

Thursday, September 13, 2007

The Dark Art of Transaction Management

Ask the folks on your team "Who can define transaction management?", expect to see only few hands raised. The number would still dwindle if the question were "What is the transaction strategy used in your application?". This is the reality. Another interesting thing is people treat XA as a panacea. Mind you, it is going to become a resource hog if used improperly.

I came across a recent presentation on InfoQ titled "Transaction Management Strategies in Mission Critical Applications". A good presentation with indepth look at the transaction, its demarcations, management and usage. I highly recommend all the fellow developers/architects to go through the presentation. I particularly liked the myths of transaction management, a quick summary of myths and realties:

Myth1: All mission critical enterprise apps require XA transactions
Myth2: Transaction O/R Mapping integration requires XA/JTA
Myth3: For combining JDBC and JMS access, XA is necessary

The realty is that many enterprise apps do not require XA at all. O/R Mappers just operate on the DB connection with some cache housekeeping that does not require XA. The last myth is the common situation in many applications. I have seen this misconception in a recent project. This can be avoided by using JMS with local transactions or with the acknowledgements.

There is a free book on the InfoQ site - "Java Transaction Design Strategies" by Mark Richards. Use transactions, especially XA with care, otherwise you need to pay the price once application is in production.

Thursday, August 02, 2007

Enterprise Service Bus and Mule ESB

Some of my friends mentioned that my blog entries these days aren't too technical. Admittedly, am cranking out lot of enterprise software :-). This purpose of this entry is to be as technical as possible and get head on with Mule ESB.

If you are a novice to ESB, I suggest to read this first. Essentially, an ESB is an integration backbone supporting the SOA. Being a strong advocate of open source software, Mule ESB has been picked up as the integration bus. There is some documentation on the Mule Wiki to start with and have the mule up and running. I'll discuss a simple example of reading a file from a folder, do some processing and publish the message on to a Weblogic JMS queue.

The first thing is to have the Mule server installed and have it running. I used Mule 1.3.3. The process is straight forward. The first time when the server is brought up, a couple of jars are downloaded. If you encounter any difficulties during this step, download the jars manually and place them at $MULE_HOME/lib/user.

Getting Mule to work for you requires no more than a configuration file and few java classes, if required. The most important one is the configuration file. The configuration starts with the "connector" element. For detailed information on the Mule architecture refer the Wiki. Since, my requirement was to read a file and publish the message on to a queue, I used the FileConnector and JmsConnector. The configuration for these elements looks like the following:



<connector name="myFileConnector" className="org.mule.providers.file.FileConnector"/>
<connector name="jmsConnector" className="org.mule.providers.jms.JmsConnector">
<properties>
<property name="jndiDestinations" value="true"/>
<property name="forceJndiDestinations" value="true"/>
<property name="specification" value="1.0.2b"/>
<property name="connectionFactoryJndiName" value="jms/MyJMSConnectionFactory"/>
<property name="jndiInitialFactory" value="weblogic.jndi.WLInitialContextFactory"/>
<property name="jndiProviderUrl" value="t3://localhost:55555"/>
</properties>
</connector>


Next, a very basic Transformer that reads the contents of the file and appends TEST at the end of each line. The following is the java class that does this. The compiled class should be packaged into a jar and placed in $MULE_HOME/lib/user.


public class MyTransformer extends AbstractTransformer{

public MyTransformer() {
registerSourceType(byte[].class);
setReturnClass(String.class);
}

public Object doTransform(Object src, String encoding) throws TransformerException {
String s = null;
try{
byte[] theBytes = (byte[])src;
String str = new String(theBytes);
BufferedReader br = new BufferedReader(new StringReader(str));
String line = null;
StringBuffer buff = new StringBuffer();
while ( (line = br.readLine()) != null)
{
System.out.println(">>>> "+line);
buff.append(line).append("TEST").append("\n");

}
s = buff.toString();
} catch(Exception e) {
throw new TransformerException(
Message.createStaticMessage("Unable to Transform Message."), e);
}
return s;
}
}


The transformer configuration in the mule config file:

<transformers>
<transformer name="myTransformer" className="com.test.MyTransformer"/>
</transformers>


Finally, configuring the endpoints. Place the weblogic jar in the $MULE_HOME/lib/user to access the JMS specific dependencies. The endpoint configuration:

<model name="READ_FILE">
<mule-descriptor name="read-file" implementation="org.mule.components.simple.BridgeComponent">
<inbound-router>
<endpoint address="file:///C:/mule-1.3.3/sandbox/in?connector=myFileConnector" transformers="myTransformer"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
<endpoint address="jms://MyJMSQueue"/>
</router>
</outbound-router>
</mule-descriptor>
</model>


That is all it takes to have the stuff working. There is not much of coding here, but configuring elements play a key role in having Mule work as expected. The info I was looking for wasn't available at once place. This blog entry addresses the nitty gritty to a fair extent. The version of Mule I used had a problem with the JmsConnector that broke in weblogic, there was no cast to QueueSender on MessageProducer in the class Jms102bSupport. I corrected this and had to build the source to fix the issue. However, this seems to have been corrected in version 1.4.

Mule ESB is flexible, and easy to configure and use. I just started working with Mule and there is a lot to learn. Suggestions, case studies on mule will be of great help to me. Feel free to post a comment on this entry.

Friday, July 27, 2007

NASSCOM seminar on SOA

Today, I chanced to attend the seminar on SOA conducted by NASSCOM in Hyderabad. There were 5 speakers in total from different companies who gave different dimensions and perspectives on SOA. The talks were pretty impressive except for the one with Case Studies. Although, the case studies were good, it was dull and boring.

The best talk was from Santosh Mohanty from TCS on Nuts and Bolts of SOA. Though, the speaker had a typical Oriya accent [pipty for fifty], he enthralled the audience with the content and hilarious tit bits. The acronyms given for the Nuts and Bolts is funny. NUTS - Networked Users of Technology and Services, BOLTS - Business Objectives by Linking Technology and Services.

I received some feedback on a similar talk organized at Bangalore from a colleague that it was not so impressive. The speakers are experts in the field of SOA and if any attendee was expecting some hard code techie stuff, the obvious response would have been "Whatz a Developer doing in this conference?". If I had attended this seminar expecting some geekiness on SOA, I'd be thoroughly disappointed. The perspective was overview of SOA, making it work for your organization, imperativeness of SOA governance and processes.

Monday, June 25, 2007

Joy of meeting a true architect

I'm in US for 10 days on a quite unexpected visit and unplanned visit. Fortunately, it turned out to be a nice one. I chanced to meet a true architect and am glad that I'll be working with him during my stay here. Itz pleasure and I'm blessed. Oflate, I have seen so many "paper architects", yeah, I mean it. There was one such person in one of my earlier projects who would literally steal the credit of any innovative work without even designing or coding it. Shame!

Sunday, June 03, 2007

Buy Vs Build with open source alternatives

Recently, we evaluated a few commercial products to solve a particular business problem. Though, the products had very impressive features, the licensing costs were daunting. Moreover, I felt that the features offered by the commercial vendors could be built in house using a combination of proven open source technologies. I mentioned what I had in my mind to my management and they readily approved and encouraged me to develop a POC within two weeks and give a demo.

The open source softwares I picked up are highly proven and famous - JBoss Rules/Drools, Quartz scheduling engine, Jackrabbit CMS. These have been nicely integrated and I knocked out the POC within a week. Many thanks to the committers on these wonderful softwares. Ofcourse, there was a bit of pain as there was no sufficient documentation and tutorials available, I had to hack around the API and source code, but over all it was a very exciting experience. Now my current task is to port the POC to the server side and provide hooks to access the functionality via web services. Hmmm, this brings in some of the routine enterprise chaos :-)

The challenging task is to deploy the Jackrabbit CMS on the Weblogic. The example shipped with source code talks about Model 2 way of deployment on weblogic as an JCA adapter. Pretty interesting! Note that JCA resources can be accessed only EJBs, servlets and not from a main method to unit test. As I look more at the situation, many concerns are getting unearthed. Little did I realize that the amount of entropy in a software system is proportional to the breadth of the system. This gets maginified further if different technologies are weaved (I desist from using the word "integrated") together and at the same time the adjecctives of the system are to be taken care of viz. flexibility, extensibility, etc and more importantly performance. Can we call this nice pabulum? Indeed! I also have the satisfaction of saving a few hundred thousand dollars for my company!!

Monday, May 14, 2007

Shelving the code

Came across this new feature called Shelving in the version control systems. Itz new to me atleast ;-). As a developer you made changes to the code, but not sure if that would lead to any issues since you have not tested the modifications and your are about to leave the office. You are also fearing that your machine might crashed before you login the next morning. Then, Shelving comes to help you.

Shelving serves as a backup on the respository but essentially, the file is not checked in. The shelving space is specific to the individual users. Shelving is not supported in CVS but in SVN and the VSTS. A really cool feature. Oh Yes, you may also argue that it is just another way of branching per developer.

Monday, May 07, 2007

Welcome to the Club!

My friends, Vijay and Rajendra notified me that they have been promoted as Architects ummm..Art Vandelays :-) in their respective companies they work for. Congrats, folks and welcome to the club. Strive for elegance in whatever you architect. All the best in your new roles. Do well.

Wednesday, March 28, 2007

Whatz fun in writing Enterprise Software

An interesting essay by Paul Graham on "Why to Not Not Start a Startup" is here. The essay talks about 16 reasons why people don't start startups. Of particular interest is the reason 4 - Not Smart Enough which states "If you don't think you're smart enough to start a startup doing something technically difficult, just write enterprise software. Enterprise software companies aren't technology companies, they're sales companies, and sales depends mostly on effort." This would make you smile at yourself.

What kind of people does a company producing enterprise software want? Great Programmers. NO! Definitely not. From the company's perspective, they need chaps who can roll out things that add value to business, though not technically sound. An average developer picked from the streets who can just produce some working stuff. All that they want is people who dance to their tunes. Put is some soft words - They want people who have faith in the management. This is how things work and no one can change it.

Thursday, March 22, 2007

Book on Middleware

There is a book on Middleware title "Middleware Architecture with Patterns and Frameworks" by Sacha Krakowiak at this link

Monday, February 26, 2007

New Books

It has been a while since I read a book. I tried my best to get an Indian edition of the Java Concurrency in Practice by Brian Goetz but couldn't get it. The Original print is atleast 4X times the price my budget for the book. Over the weekend, I purchased three books - Head First OOAD, Ruby Cookbook and Beginning Ruby on Rails.

Being a big fan of the Head First series, I started out with OOAD book. This is a good book even for the seasoned professionals. Keep in mind this is NOT a reference book. Brett, Gary and David have done an excellent work capturing all the required of OOAD in a pleasure to read book.

Ruby Cookbook presents nice recipes with Ruby. Very well presented. It is good point to start picking up Ruby.

As far Rails, am still a novice. The next month my technical arsenal is going to get enriched with Ruby and Rails :-)

Friday, January 12, 2007

Did you forget to sell yourself?

I started blogging with the intention to blog ONLY technical and technology related stuff and had always desisted from publishing "sensitive" content. But this time, I couldn't resist my frustration and out it comes.

I guess, it is the time of year end appraisal in most of the companies..oops, Software companies. Put in other words, it is the time for "Shameless bit of Self-Promotion". I have been observing my colleagues for a month and there is a dramactic change in their behaviors. Everyone is aware of the famous "recency effect". It is also interesting to watch how everyone is bent on blowing their trumpets. One of my colleagues rephrased it and called it "Way of advancing in career". I feel like pursuing a course in behavioral science ;-)

This is also the time the managers have to walk on a tight rope balancing the hikes against the performance of the individuals without losing valued employees. A really tough job!

A word to fellow developers - in pursuit of technical nirvana, do not neglect the "Way of advancing in career".

*** UPDATE ***
Honest way of selling yourself - here are a few headers suggested by my friends
1. Delivery of the Work Item - Explain how the work item is delivered on time, on budget,...
2. Quality of the Work Item - Elaborate on how technology has been leveraged for business and dexterity in applying the technology
3. Flagship work done - Enlist any flagship work you are proud of
4. Demonstrated Leadership - Applicable if only in a leader role. Mentoring of team members.
5. Overall contribution to the project/product release.

Some companies do insist that it is the responsibity of the individual to look into other projects and provide them techcnical direction, even though people from other projects don't approach you for help. Doesn't it sound funny? Well, it isn't this is called "Way of advancing in career" LOL