Category Archive : Engineering

Cairngorm 3

I chanced upon this yesterday (http://sourceforge.net/adobe/cairngorm/home/) and was impressed with what they are trying to do. Building upon Parsley looking to do a lot of injection and also support modules that they have been criticized for in the past.

Looks like Adobe Cairngorm team finally got it right.

Eclipse takes a leap with Marketplace

This is something not new to world, but is to me. Last night, when I started to upgrade my development environment to use Eclipse Helios, the very first thing I needed was a plugin to get met maven based projects working – m2clispe. Like in the past I started to search the net for a URL that I can dump the “Install Software” screen and navigate through the various options and then find any missing dependencies to get that going.

But, I was in for a surprise – Eclipse Marketplace. I read about Eclipse launching a marketplace a while back, but because I was not actively developing back then, it did not register. However, a tutorial reminded me the Marketplace.

The experience from there on was simply wonderful, something that I am not familiar in the Java world of development. Kudos to the Eclipse team to get this one going.

Nest step if to install many more plugins in my new Helios before I get back to development.

 

Who the hell needs Quality?

I Do; you do; our customers do; Period

Well we all know the answer, but is it really what we believe in? The more important question is how do we choose to deliver quality when we can not measure it?

A few months back, I was sitting in a meeting where the conversation went something like

Business Person: So we need 24000 hours to deliver the scope of the release?

IT Person: Yes. But this does not include the hours needed to fix defects that we will have in the application at the end of development lifecycle.

Business Person: So how many defects we had in last release – I assume about 700?

IT Person: Yeah.

Business Person: So I can expect 2000 in this release? How much time do you need to fix one defect?

IT Person: About 16 hours per defect

I will let you do the math, but what made me fell out of my chair was the fact that everyone in the room was accepting the fact that even before we were developing the application we would have 66% of the time spent in fixing defects. Not even once did anyone asked, how can we ensure that we do not have so many defects in the application. Now even once did anyone asked if we already have Unit testing how come we still have these many number of defects.

Well, this is not the first time I heard this conversation and I am sure not the last time. But, I wonder how do people reach Architects, Project Managers, Program Managers and Directors IT if they have these discussions.

I did not say anything in the meeting, because I was supposed to sit there and listen which is another sad story. I could not even say anything to my IT team once the meeting was over; I was just not supposed to. Maybe, if someone who was in that meeting reads this and can co-relate I would be in a big shit of trouble; but I am going to risk it – do not know why.

I am someone who can not start writing a piece of code without having a unit test before it (Test Driven Development). But, then the projects I have been working lately do not even automated unit testing let along TDD. Their unit testing is done because they have to compliant with the Quality Process and at times it is done with a set of people who never coded it. The unit testing team works like a QA team but is withing the realms of the development team itself. And then there are times when Unit testing happens in parallel to System Testing.

This is a rant, where I hope I can pass a message around importance of testing.

 

Dilbert - Quality

Dilbert - Quality

 

 

 

 

 

 

 

 

Related Articles

BlazeDS and Spring

A few days back I posted the latest addition in Spring family – Flex with Spring. Being a huge spring and flex fan, I was very excited. Now able to reuse Spring knowlege in Adobe Flex is a wonderful idea.

I faced a few challenges in using the solution and discussed the same on the spring forum

It comes out to be a common issue with the Client compilation and non-availability of channels. Luckily there are a few workarounds that will not stop you from adopting this framework.

If you want to get a god head start, you would like to read on at: http://www.gridshore.nl/2009/01/05/wow-springframework-enters-the-actionscript-and-flex-domain/. This was something that I was going to blog away muself today. Thanks for Jettro for saving me the time ๐Ÿ™‚

Have fun.

Managing Code

Do you write code locally for personal use/reference? If the answer is yes, then this post is for you. For others, it may be worth still to read it.

I have been working on a set of projects for last few weeks. Today, I wanted to make some major and possibly destructive changes to the code base. Before I started to change code, I took a backup of the local folder into another folder so that I have a revert point. At this point it hit me – I am missing version control, that I enjoy in my corporate world.

I dropped everything and started to setup my laptop with the version control. I did the following:

1. Downloaded SmartSVN or TortoiseSVN as subversion client and install on your machine.’

2. Download Subversion client for windows from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100

3. Downoad Apache HTTP server to front-end the subversion server from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91

4. Install svn client and apache. Steps are simple and can be found with the downloads.

5. Configure Apache wotk with SVN. Read the post http://svnbook.red-bean.com/en/1.0/ch06s04.html

6. Start Apache and hit http://localhost:80/svn/. Provide a different port number in case you changed the apache configurations.

7. Create a local repository on your hard disk by using the command line “svnadmin create foo”. This will create a repository in the same folder from where you ran the command.

8. Open a browser and type http://localhost:80/svn/foo. This will show a repository view to you.

Whola, you have your code base in repository. Enjoy it!!

Java Collections | Performance Benchmark

Managing list or collection of objects is a very common scenario. In addition, managing that list effectively, that provides the optimum performance is also a very common need. The Java programming language offers many in-built data types for representing and modeling collection of objects. Some of the commonly used data types are:

java.lang.ArrayList

java.lang.HashSet

java.lang.TreeMap

ย 

Each of the data types behave differently under different scenarios. In addition, when writing algorithms that demonstrate highest levels of performance it is necessary to make the right choice. For many developers and architects it is not an easy choice.

This document provides details of a comparison done across various data-types supported by Java Collections Framework. In addition, it will study their performance under different circumstances.

Final complete analysis in the java-collections-performance-evaluation document.ย  Dowload PDF.

Flex Best Practices

I came across this video recording of James Ward presentation on Best practices with Flex. Do take the time to go through the complete video

Handling Dates across different geographies

This is a tricky one – evaded me for a while. Synopsis of the issue:

Flex messaging (BlazeDS is what we were using) deals with dates in a very special way. The dates are transferred to/from client / server post conversion to UTC and then they get converted to what local time zone. Let me take an example: If you are running the application server (JBoss/tomcat is what we were using) in EDT timezone. Then if a client browser is running in IST time zone the dates would get converted when passed to the server from the client. If a user was to select a date July 29th say 9:00 AM IST, when this date is sent across to the server this will first converted to UTC on the client, then sent to the server across the wire. The server would then convert the time from UTC to EDT time zone. This would mean that time of 9:00 AM IST would get converted to 11:30 PM EDT (pardon me if my time conversions are a little off ~ I hope you get the point).

And this is very much documented by Adobe as “the way” of handling dates and you can not change it without changing the open source code – which i would not recommend.

So, how to solve the issue? There are some quick wins out there, but nothing a realy true fix that i came across. Following are a few links and also my assessment as to why I dont not find them the right fixes:

http://flexblog.faratasystems.com/?p=289

This solution recommends to set the server’s time zone to UTC. Also, they themselves recommend to be careful about global and local time as that can cause some issues. Basically, you can control the time on the server, but you can not control the same on the client which still leaves you with the conversion issues. The time window (as per my example) would be reduced to 5.30 hours, but that will still remain.

http://blog.shrefler.net/?p=13

Again a way to write a helper method that will convert the time on the client (Flex) from local to the UTC which would then be sent over to the server – this solution as proposed askes us to ignore the time zone completely and also needs a helper method that needs to be invoked everywhere you need to send the date back and forth. Works, but not ideal!!

What do I recommend finally?

Well, i tried overriding the serialization mechanism completely – The solution works ๐Ÿ™‚ but I have no one to provide me feedback, hence I am looking for suggestions / recommendations here as well.

My need was simple – i did not want to use the time part of the date as the user had selected and hence ignored it completely. We need to do 2 simple configurations:

1. Action Script – Write an AS object that represent a date. This class should implement the flash.utils.IExternalizable interface. This class would the client representation of the date object. The two methods that should interest you are “encode” and “decode” as these are the ones that encode the date into a string and then later on decode the same back to flex object. The file in PDF form

2. Java POJO – A POJO is needed on the server to which the client (AS class) will bind to. Similar to AS, the POJO should be able to decode and encode what is being received and sent. The functions on the Java side are: parseFlexEncoding and toFlexEncoding. Also, similar to AS this class should impement the java.io.Externalizable interface. The file in PDF form

Just put these two classes in place and then use these instead of the OOTB date object and you are all set.

The solution works as I have POC ready for this both in tomcat and JBoss, but I am looking forย  feedback and improvements on the same.

Have fun..!

Flex and Maven – a better integration

I came across this website that calls out for Mojos for Flex. Something nice that can take the ant out.

Performance | Advanced DataGrid rendering

In one of my projects there were some custom needs where we wanted to display values in cell based on the data passed. This led us to write custom ItemRenderer’s. Considering that we were creating multiple instances of Containers like Canvas, Box with-in led me to thinking how would Advanced Data Grid, respond to this custom code. Upon certain tests for 100 to 10000 rows i came up with good looking results. Find them in the document.