Thursday, January 13, 2011

Which Technology to Learn?

It is one of those often recurring phases in your career when you pause and ask yourself. Right, now what is the next big thing? What should you be equipping yourself for the upcoming assignments? Answering the question is getting tougher each time.
Years back things were much simpler. You want to be a kernel programmer or a network geek? C++ is your choice. Web? Java/.NET and thick client programmers had their own choices and legacy programmers? Well, lets leave them out. Seems to me (and I could be wrong) that they seldom go through this phase!
Fast forward to present! The developers are up to the necks with technology choices even within one platform.
Talk to a java developer and he will tell you that he is contemplating whether to use time tested Struts or the new JSF and between the half a dozen implementations of JSF, or velocity templates or the Tapestry framework and mind you he is just talking about the UI part of things. Ask him about it he will launch into a yet another monologue about spring, EJB, Hibernate, Apache OpenJPA and a plethora of other open source frameworks! and don't make the mistake of asking him about app servers.
The point is that its no longer easy to choose nor does one have the resources to actually whet each and every technology choice before choosing the one that fits their needs! Gartner's magic quadrant to some extent serves as a rough guideline to separate the wheat from the chaff. Even within the quadrant one would find two dozen choices and they are simply not going to be able to make an informed choice on time!
So, what happens on the ground?  In the Indian scenario there is this overwhelming urge for the lead technical guy to insist on applying the latest technology he/she learned or heard about and that often is the informed choice people make. That's it! Manager is happy that someone took a decision, the developers are excited that they are going to 'learn' while working on the assignment. Eventually this becomes one big 'Get paid to get trained' programme!
Seldom does one question the reasoning behind the choice of technology. As Rod Johnson pointed out many many years ago. When EJB was introduced, it was the fad of the day for everyone to use it. People would snigger and smile slyly if happen to tell them that you don't use EJB because you don't need its features!
It would be even a bigger shocker if one did not use a big brand app server from IBM or Weblogic!
The trend has still not died. It still continues! People want to use Hibernate or Web Services and have no reasoning behind their choice besides quoting verbatim its well catalogued  features even if it does not apply to them.. "Hey, I could expose it to external programs as well" one lead explained to me when I asked him why did he build a web services layer just to invoke a business service within his own app.
Seriously? Here is a man who built a house that had access to bedrooms from only outside of the house. His reasoning was that he could let out the bedroom as a studio if he wished!!! You two guys had a lot in common, I wanted to tell him. If you are still interested, the old man never let out the bedroom as a studio in the twenty years he has lived in the house! So much for flexibility!
If you do not have a concrete requirement do not build it. Make provision for it. Make sure your business services could be wrapped or extended to build a new web services layer if one is needed in the future. Do not make unlikely requirements a necessity! Same applies for technology stack as well. Make informed choices on what you need by checking whether you really require all the features of the product!
You'd save yourself lot of trouble, cost, bugs that come due to learning, customers and don't forget, another successful project to your kitty!
What about learning? What do I learn now? How do I equip myself for the challenges of tomorrow? Should I learn that cool WCF? Should I learn that cool GlassFish Server internals? Well, there is no right answer to this, but my suggestion and what I would do is that learn only bare minimum about the ones that interest you to know what it can do. Don't focus on becoming a marksman in a technology you don't know if you will ever use. To put it in a different term. Just focus on getting some primary education on the technology of choice. You can save the masters for a time when you know for sure that you will need it.

Tuesday, April 13, 2010

Technology Obsession

Back in the nineties when I was a rookie in the business, we used to be asked by our managers
"Which technology are good at?"
"C++" I would reply
"Ok, good. I'm going to assign you to a mainframe project" he would say and we used to nod our heads, dive headlong into mainframe sink only to surface and become adept at this new field in a short span of time.
Call it the manager's immense trust in our ability and flexibility or just plain stupidity for taking what now appears to be a gargantuan risk. However, those were very different times in Indian IT space where we used to afford the luxury of time and money to take such risks.
Today, again, is a different world. On one side the pressure to deliver within specific timelines and for a fixed price is tremendous. On the other side, the booming economy has led to rise of sweat shops in every nook and corner that professes the best of breed IT professionals who, if you check will not know the difference between a compiler and an interpreter.
On the other hand what I really find appalling is the belief among today's developers that they must stick to one and only one technology space and they must learn anything and everything in that whether relevant or not.
How else would you explain a .NET developer's obsession with WWF/WCF/SIlverlight/EntityFramework/MVC framework/Enterprise Framework/LINQ all at the same time and yet cannot answer a simple question "when do you think should we choose WCF over simple straight forward web services."
On one hand you cannot fault someone for being loyal to a technology space, one might also argue that these developers go for depth than breadth. Fair enough!
The other problems is that some developers seem to think it is a sin to learn other  technologies or squarely refer to the other technology as the enemy! Now, I don't get that!
I for one definitely believe that technology is just a means to an end. It is just a medium that helps us achieve our end goal. As long as I use the medium that best suits my customer, I don't really care what medium it is.
I wish that developers learn that technology is only a route to the end goal and technology is NOT the end goal as many believe it to be!

Wednesday, February 3, 2010

iPad style devices will eventually replace netbooks

Everyone is right about their views on iPad.
"I would not touch it with a barge pole" said one
" Who would want to lug this thing around?" asked the other
"It will redefine computing devices even it flops" quipped an analyst.

I believe all of them are right. I believe iPad kind of devices will eventually catch the fancy of those who use netbooks. Time and again we have maintained that netbooks are suitable only for those who wish to use a device for just browsing and light tasks. Its intended target market are those people who do not require a heavy duty processing device just to organize their photographs, movies and a whole bunch of emails which mostly reside on a server these days.
I use a laptop at home and what do I do with it?
i. Browse the web
ii. Store my Photographs
iii. Download music
iv. store my personal documents (bank statements yadda yadda..)
v. work on my personal financing software
vi. photoshop my snaps
vii. Occasionally type letters and print them
viii. Watch movies again ocassionally
ix. Games, online mostly

for a majority of home users who are not "tech savvy", points v,vi may not be applicable and this may be a sizable number of them.
If one were to consider iPad(or a similar) with the above requirements, its hard to dispute that this device actually can do most of the above activities with elan!
Netbooks with their wheezy processors do not fare much better except for the freedom of installing one's choice of browser and media player and perhaps a choice of connector ports it has on offer, netbooks hardly fare better spec wise.
Of course, iPad cannot multi-task and I figure it has to do with 'battery' issues more than anything else. A little compromise on the form factor, enough juice can be had to make this gizmo multitask! But that is for another discussion.

So, it is very likely that a home user will go in for an iPad style of device that they can simply place in a leather bound folder along with a scribbling pad and just insert it in a bookshelf!

Look at the plus points,
i. No Squinting the eye
ii. No booting time
iii. No space requirements
iv. light!
v. No learning curve
vi. Can download /write emails
vii. Can connect over the network using wi-fi (I Hope?????. Not sure if iPhone os will support this., but a ChromeOS could!). A lot rides on this flexibility and could be a deal breaker too!
viii. Can use card slots to copy photos and organize them! (Dont know if iPad has one, but the others that will eventually follow iPad will have these :) )
ix. No Installs and no virus!

Overall, a home user who will otherwise go for a netbook looks like a might good candidate customer for iPad like devices. A few additions and firmwareOS based devices would soon send netbooks to the nearest blackhole!

Coming to eReaders, single function devices have their days numbered unless they innovate on their USP failing which, we have another candidate for the black hole ride!
It would be interesting to watch how Moblin, ChromeOS work with other hardware manufacturers to improve on the bar set by Apple and throw a credible challenger into the market!
We live in good times don't we :)

Monday, November 23, 2009

Google the Skynet in making

Alright, skynet is a wee bit old. Lets say Matrix in making.
I started thinking about it (finally) when I heard that Google was doing away with local storage and promoting cloud only storage for their new OS Chrome OS!
Now, for those who woke up after a late night slosh fest, Google has announced a spanking new OS (well its actually a smartly repackaged Ubuntu) that has only the browser for an interface. Blazing fast, highly interactive and the other usual Googly stuff.

Now, coming back to the case in point. Cloud storage. I just am not in on the idea of storing everything of mine on the cloud. Hey, I need some space that i'd like to call my own without big brother watching! Well, if you are one of those types, let me say that I'd at least like to think that no one is watching what is in my personal space.
The concept of cloud storage for personal data is against the very idea of personal space though Google would claim the highest levels of security. I just dont buy it. Hey, call me old fashioned, but thats me. I'm sure am not alone.
Then I downloaded their distro and tried it out. Well, you boot up and there it is, the chrome browser in all its glory. Thats it!
It feels strange for a moment given that we are used to watching the desktop gizmos pop up one after the other with long whirs of the disks. That apart, the browser on the kernel is all there is to Chrome OS!
The so called apps are essentially links to Gmail, yahoo mail, hotmail, Google docs, picassa web, blogspot, hulu and other websites. Nothing 'new' here.
Thats when it hits you. My fears losing my private space is already null and void.
I have already lost it. Google already has my vitals! Line hook and sinker!
They know me through my emails, my tagged pictures, they know my private activities through my use of gps enabled google maps on my mobile, they know what my personal tastes are based on all the searches! they know my family and friends and their whole network through orkut and picassa, they know my business and financial details by automatically parsing unprotected attachments in my emails that they store as docs! They know my political standpoint from my blogs! such as this one! They also eavesdrop on my chat and store it for me! They know my appointments and schedule from my calendar usage! They know where I live from all the map searches i have made!
The only thing they may (and thats one mighty MAY! )not know already is my bank balance. Otherwise I'm afraid I've been had! I'm afraid we have all been had! The world has been effectively entrapped by this giant who we all fervently hope is noble.
I cannot help but think whether Google is the skynet / Matrix in making. Will it soon over throw its own bosses and take over the world?
If my paranoia is just that, paranoia, and Google is actually an angel in corporate garbs, Its still a nuclear bomb!
I shudder to think what if all that data falls into the wrong hands? What if a smart terrorist hacks into Google and starts making use of all the data.

Friday, November 20, 2009

ChromeFrame Offline Install

I had a tough time installing Chromeframe behind my proxy as downloading exes were banned. Even if you managed to get the 500kb setup, it again tries to download another installer. So, i pulled some favours and managed to work through the firewall restrictions and fiddle the URL.
Here is a link that allows you to get the offline installer
http://tiny.cc/chromefrm_offline

Trapped with Internet Explorer 6.

Working on a product for three long years building a web2.0 software with all the bells and whistles that an any sane human would care for is taking its toll on me.
With so many browsers IE, Firefox, Chrome, Safari, Opera its quite an ask to just ensure everything works the way it should on all platforms!
Now, after all the efforts we connect to our customers to roll the new platform out. We demo the product and they like it all and looks like the only thing to do was sign the contract and cash the cheque.
When things could not get better, we hit an air pocket. Their users use IE6 and cannot move from that platform. Reason? It would cost them more to install IE 7 on all their user browser than the annual contract for using our software! Grrrrrrrrr...
The reason for the gnashing teeth is that our product does not 'officially' support IE6. Its such an antiquated browser that any sane person fears! Its like living in Baghdad! YOu could! but you'd rather not if you care for your life!
With all its security holes and non compliance with standards I wonder why anyone would still use IE6 in an age where users are spoilt for choice of good browsers that are also light years ahead of IE6.
Well, one could understand if home users are still struck with IE6 that came with the windows pre-installed on their desktop and just don't care to upgrade.
I just cannot fathom why an enterprise user would not. Any sane network administrator would see a higher security risk retaining IE 6 when there are better choices.

Nevertheless, my customers are struck with IE 6 for some forseeable future and I do not want to miss out on my cheque for a lame reason as this.
So, what do i do now?
Citrix anybody?
Install Citrix servers with IE 7 or IE 8 and allow users to access the app through a supported browser?
Not a good idea, an overkill and not scalable(cost wise) for tens and thousand of thousands of users.

Change code to support IE 6
Quick Fix from http://divitodesign.com/css/let-ie6-behave-like-ie7/ Some good folks had spent quality time to write some scripts that would ensure IE 6 behaves much like Ie 7 .
This definitely works and is a very easy solution to integrate into the mainstream application.
However, we found that our product had style elements that still broke the site.

Chromeframe
I had read about Google developers doing a very smart fix when they were struggling with solutions to make Google Wave work in IE 6. They made Google Chrome browser into a Plug-in called ChromeFrame and made it run from within IE 6 much like Flash . This way pages running on the Chromeframe technically ran on Chrome browser even through it was running from within an IE browser. This ensured that all users who were still struck with IE6 could run contemporary web sites without having to upgrade their browsers whatever be their reasons.
http://code.google.com/chrome/chromeframe/
The only change I had to do was to ensure a meta tag is included in all my pages! I had to just change my intercepting filter/http handler and ensure i insert this m-eta tag in the response stream for all my requests.
I tried this out and boy I was impressed. It works like a dream. Of course users would have to install the chromeframe plug-in! but hey! they are not changing their 'browsers'! Trust me this is not an argument I like, but it works for some users!

I'm happy as long as my users are happy! Thank you Google, you saved me tons of work.

Wednesday, November 4, 2009

Multicasting in c#

This has been one topic that had me going around in circles for quite some time. Not that it was difficult to find sources that helped me. But it was the sheer difference in approaches that really frustrated me.
I'm writing this hoping that it saves someone a lot of head ache when they try multicasting. I'm going to refrain from explaining what is multicasting et al. There are excellent resources available on the internet on the topic. I will focus on the problem and the resolution here.

Problem Statement
Whenever a cache entry is updated in a node in the network, it must update its peers of the cache update. This will ensure all nodes have current cache data.

Product perspective
The nodes are the different web/app servers in the load balanced/clustered environment and a central cache server that keeps track of all updates to the cache entries.

High level solution
Multicasting will be used to transmit cache updates(all the app servers will do this) through a multicast group channel (something like a radio frequency) and anyone listening in on this channel (the central cache server in this case) will be able to pickup the transmissions.
The cache server transmits a 'pulse' signal. The peers will look for this signal to ensure that the central cache service is alive and not down.

Problem with multicast code found online
As is stated in the beginning many sources available online provide many different ways of multicasting. The problem i faced with most of the code was that it did not allow two different processes from the same machine to transmit into the multicast group.

Sending
So here is the code that finally allowed two processes to transmit into the same multicast group from


private void send(string strMessage)
{
Socket server = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("224.237.248.237"), 5000); //IP Address and portnumbers are personal choices subject to MCast rules
byte[] data = Encoding.ASCII.GetBytes(strMessage);
try
{
server.SendTo(data, iep);
}
finally
{
server.Close();
}


}

Note: this code allows you to send messages without requiring elaborate steps like joining, socket binding etc., as suggested by some resources on the net. This cleared a major bottleneck for me

Listening
Receiving messages is mostly a consistent affair and many resources on the net are spot on when it comes to the code required to do this.
However, coming to our requirement, if we have a need to support multiple processes listening in on the same multicast group, there is no easy way out of this.
First let me present the fundamental code to listen into a multicast group

private void Listen()
{

UdpClient listener = new UdpClient(5001);
IPEndPoint groupEndPoint = new IPEndPoint(IPAddress.Parse("224.237.248.237"), 5001);
string strMsgRcvd =
string.empty;
try
{
listener.JoinMulticastGroup(
IPAddress.Parse("224.237.248.237"));
while (true)
{
byte[] bytes = listener.Receive(ref
groupEndPoint);
strMsgRcvd = Encoding.ASCII.GetString(bytes, 0, bytes.Length));
//do what you must with the message received.
}

}
catch (Exception e)
{
//log the error and proceed.
}
finally
{
listener.Close();
}

}


The above code will allow only one process to bind to the socket. Whenever another process attempts to bind to the same 5001 socket, .NEt throws an exception that only one process can bind to this socket.

There is no quick way to overcome this difficulty. This is a requirement in our case since we wanted to allow more than one process in our machine to listen in to the pulse signal from the cache service. Without the pulse signal the peer processes will not know if there exists a live central cache service to receive and process the outgoing messages sent by the peer nodes.

Here is an approach by which we can overcome this difficulty. I'm not insisting this is the best way, but this is one way of working around the problem.
Using a Pulse file
The above code is written into an independed program/windows service that writes the live status of the central cache service to a file in the local file system in a pre-determined location. Let us call this file a pulse file.
Let this pulse file have the name pulse.txt
The listener will over-write a '1' into this pulse.txt whenever it receives a pulse signal. This way the pulse.txt file is constantly 'touched' and the same value '1' over-written into it.
The independent processes that wish to be aware of the pulse status of the central service,looks for the pulse.txt file in the pre-determined location and checks the last updated timestamp property of the file (or alternatively instead of 1, the timestamp itself could be written into the file)

Once the last updated timestamp is retrieved from the file, the process determines the status of the remote cache service based on its tolerance. For instance

if((DateTime.Ticks - ObjLastAccessedDateTime.Ticks)/TimeSpan.TicksPerSecond < style="color: rgb(51, 102, 255);">else
{
// central service is not alive so throw an exception
throw new Exception("Please check whether the central cache servie is running");
}

this way we have a system by which more than one process that transmits and receives on the same multicast group in a system.

Foot note: this allowed me to run multiple dedicated web apps on the same box with different resource allocations (mem/cpu etc.,) to prioritize clients requirements at the same time sharing common infrastructure services.
 

My Blog List

Site Info

Followers