Saturday, June 21, 2008

Abstract Factory Pattern

Along with Vidula, I had been assigned to do a series of tech talks on design patterns. Our initial objective is the cover the eight software design patterns that has been deemed to be most important. I will cover four of these patterns and hope to have the slides on the blog after I complete the tech talks. In the series of these tech talks the first was on abstract factory pattern and here I have attached the slide along with this blog.

At the end of the presentation some interesting aspects and perspectives on this was discussed.

Error opps "errors"

First a staring error in the diagram was pointed out by Thilina, where one of the concrete factories was not shown to have been extended from the abstract factory, my apologies for not noticing that!

Any how I will not accept the other error that was pointed out, where it was said that piece of code was misleading in the main method, since I have not handled any other cases(when its not EU or Canada). Unfortunately I feel that code that I write on slide for a presentation is not for the purpose of code review, but is intended to be coherent with my overall objective of getting the usage of the abstract factory pattern to the audience. Further more I had to consider the space that I have on each slide to play around with , probably if my overall objective was to explain the usage of the if else statement to a group of amateur programmers then I would have accepted that I had made a glaring error in not handling the other case and logging it J

Usage of the abstract factory pattern in a spring application

Spring being service oriented architecture enables the injection of the objects which implements the defined service interfaces. It just does the job of the abstract factory pattern and in the words of Harsha it is almost 80% of the abstract factory pattern, any how a purist could argue that it’s not an abstract factory as it does not comply with all the requirements of being an abstract factory.

Switching between different kinds of message sending implementations

A common scenario that we face is having various message sending mechanisms to choose from and is required to switch as and when required for example from email to sms or ussdc …. The question was this if abstract factory was appropriate for this purpose? At the outset it might sound to be appropriate, any how if considered with respect to the other available options it was suggested that the strategy pattern might be more appropriate.

A wait the next design pattern slides!

Thursday, June 19, 2008

Google , Yahoo and Microsoft does it matter to me?

Skimming through the news papers I was in a rude shock to see that Google is coming to Yahoo's rescue at the face of a hostile bid from Msft. This made me wonder why people say that there aren't any permanent fores or friends only in politics, business at the highest level is also seeming to be making strange bedfellows.

The history behind this present situation is very interesting and plenty has been written about it and analyzed about these three companies, Google, Yahoo and Msft. Msft has been the forefront of providing user friendly but proprietary OS and its chairman has been topping the worlds richest list since Msft became a household name in the early part of 90's.

Yahoo, had its humble beginnings as ones hobby went onto become mother of all Internet based companies established itself in the forefront of Internet marketing, till the emergence of a start up in the name of Google, who fought a rough battle with Yahoo and incidentally dethroned it from its established position to become the leader. The tactic of having contextual marketing and along with it a more powerful search algorithm against a business that was already established.

Being just another observer of this battle for some time I have my own thoughts on the matter. I had always been mesmerised by the rise of the Google and happy to see that it is a good example of how simplicity can succeed even in the very dynamic business environment, specially its simplicity in interfaces and the meteoric rise it has gone through from its humble beginnings had always been things that I had been interested about. Any how personally does not like the idea of yahoo being brought under its wings, if we are to have a sustainable Internet market probably we need a healthy competition and not a monopoly. Only in that case will be the users like us will be befits from the occasional spills they make in the event of cut throat competition. I can remember the way the web mail account size suddenly started to burst and come to age! That happened for no other reason than competition.

But on the other hand yahoo falling pray to Msft is worse than that! So probably from a users perspective I would love to see the mooted partnership between yahoo and Google might be the best for us, as its obvious that yahoo is not in a position to convince its investors unless it comes up with some sort of a viable strategy to generate sufficient cash in the fore see able future.

Thursday, June 5, 2008

Intelligent Ant


You might have heard about swarm intelligence where a group of ants acting as in concert exhibit intelligent behavior. But when these ants are considered individually they do not normally exhibit any intelligent behavior. But the other day I was in for a strange surprise when the hsenid ant individually exhibited intelligent behavior, when it was placed in captivity and harassed by tying objects on its sensors, it reacted correctly to suit its hostile environmental condition.

The news reaching us from sources related to the ant says that the ant is planning a great escape from its abductor and might end up in one of the other tables nearby, where it can have its eye open!