Thursday, March 12, 2009

Carbonizing SOA

It's probably bit late to blog regarding this subject, but what the heck? After all, late is better than never.

WSO2 folks released their flagship product, the mother of all open source SOA solutions, WSO2 Carbon – Middleware a la carte. It is a componentized, customizable SOA platform built on Equinox and OSGi. The platform can be configured and tailored to suit the enterprise architecture of any business organization. Among the major components of the Carbon platform are;

1.WSO2 Web Services Application Server 3.0
2.WSO2 ESB 2.0
3.WSO2 Registry 2.0
4.WSO2 Business Process Server 1.0

All these high level components share the same set of core Carbon modules. It is really exciting to see how those high level middleware solutions combine with the core Carbon framework to deliver the results. Sounds interesting? Feel like learning more? Here you can find an introductory presentation on WSO2 Carbon. It gives a good insight into this revolutionary product and its architecture. Also don't forget to checkout other related articles and presentations on WSO2 Oxygen Tank.

Tuesday, December 9, 2008

Going Undercover....

I recently completed the video game 'Need for Speed Undercover', the latest member of the popular NFS series by EA Games. The game was so exciting and thrilling that I had to blog about it.

I have been a big fan of the NFS series since NFS 2. I really liked NFS Underground, NFS Underground 2 and NFS Most Wanted. NFS Underground was the first game in the NFS series to have a base storyline. Underground 2 and Most Wanted took the NFS series to a whole new level by making the storyline even more exciting and adding more features to the game. However I was a bit disappointed when NFS Carbon came out. It certainly did not live up to the hype and I found the game rather short and less challenging compared to its predecessors. Things got even worse when they released NFS Pro Street. To me Pro Street is the most unsuccessful game in the whole series. The whole point of playing a racing game on your PC or PS3 is to drive extremely fast and crash into things (which is something you cannot do in the real world without hurting someone or getting brain damage). But Pro Street does not allow the player to do that since going fast and crashing into objects would cause your car to get totaled and immobilized. Also fixing damaged cars will consume large sums of money the player has earned in the career mode of the game. And the biggest problem I had with NFS Pro Street was that it took the game back to the world of professional racing on closed racing circuits. For somebody who liked the virtual street racing experience offered by NFS Underground and NFS Most Wanted getting used to racing on closed tracks is almost like getting tortured.

However it seems the folks at EA have learned their lesson from the feedback they got from the fans for the NFS Pro Street. With NFS Undercover they have taken the action back into the open streets. Player gets to ride in a virtual city in some of the finest auto mobiles of the world. Couple of cars worth mentioning are Bugatti Veryon and the McLaren F1 which was last available in NFS 6. Cars are categorized into three, namely Japanese, European and American (see complete car list). However NFS Carbon fans will realize that these three categories effectively map to the three car categories in NFS Carbon (tuners, exotics, and muscles). The city has plenty of wide open roads where the player can really push the cars into their limits. Most of the tracks enable the player to accelerate the car to its top speed and hold that velocity.

Another aspect of the game I liked most was the soundtracks. Predecessors of NFS Undercover had mostly hard rock and technical death metal oriented sound tracks. But Undercover brings you a little bit of pop, a little bit of Latin and even a little bit of Spanish in addition to the rock stuff.

The underlying story of the game is perhaps the most interesting feature. In the previous versions of NFS the storyline was simple and very much predictable. In those games there is some kind of a bad ass, champion racer who bosses the other racers in the town (for example Razor in Most Wanted and Darius in Carbon). The player enters the world of racing as an amateur and starts to work his way up to become the new racing king of the town. In the process the player will have to confront many other racers, companions of the existing champion and sometimes even the police. But NFS Undercover brings you a totally different storyline. The story is full of action, suspense and even a bit of romance. The storyline clearly has some traces of 'Gone in 60 Seconds', 'Fast and the Furious' and 'CSI Miami'. Also the game enables the player to play the roles of the street racer, gang member, car thief as well as the federal agent.

The game is pretty fast paced and action packed. Graphics and the related effects are so natural and realistic. It's everything the racing gamers ever dreamed of. If you are like me and if you haven't played Undercover yet then go for it. It's totally worth it. Well done EA. You guys rock!

Also don't forget to check out NFS Planet for some cool Undercover wallpapers and movies.

You are not good
and you are not bad.
You blend and you listen
and you don't trust anyone.
Once you go undercover
you are on your own.

Thursday, October 23, 2008

MOINC - The Future Web Services!!!

As Web services continue to become the dominant paradigm in the arena of distributed computing, more and more people around the world are starting to get interested in improving the performance and scalability achievable from Web services deployments. An enterprise grade Web services deployment must be high available and scalable in order for it to be useful to the clients and provide a competitive advantage for the service provider. Due to this reason it has become a must for the Web services middleware providers to support high availability and scalability via general techniques such as clustering.

Me and some of my colleagues recently started a venture to explore the potential of grid computing as a means of improving the availability and scalability of Web services deployments. Our plan is to design and develop a complete open source Java Web services deployment platform which makes use of grid computing as the basis for clustering. This exciting concept is a brain child of one of our lecturers at the Department of Computer Science and Engineering, Dr. Sanjiva Weerawarana, who also happens to be the chairman and CEO of WSO2. This research project focuses on not only improving the scalability of Web services deployments via grid computing but also putting the much wasted electrical energy to good use by getting idling computers to do some useful work.

We have named the project 'MOINC' which stands for Mora Open Infrastructure for Network Computing. (If you are confused what 'Mora' is all about it's a little nick name for the University of Moratuwa. 'Mora' also means shark in Sinhala.) So far we have managed to successfully complete the requirements gathering and design phases of this massive R&D effort. We have identified four components in our target platform and four groups of undergrads are working on implementing the components. The four components are;
  • MOINC Server
  • MOINC Client Agent
  • MOINC Server Manager
  • Thisara Communication Framework
You can learn more about our project and its four main components from our official website. You will also find links to our design documents, proposals, specifications and SVN repositories there. We recently released the 0.1-alpha version of the Thisara messaging framework which is one of the four components of the MOINC platform. You can download the binaries from our website too.

Friday, October 10, 2008

Google Chrome, Looking Good

It seems almost everybody is taking a strong liking into Google Chrome these days and almost everybody who has downloaded it seems to be appreciating it a lot. So I myself thought of giving Google Chrome a trial run. 

However I have to say that my first impression on Google Chrome was not a very good one mainly due to the fact that it’s only available for the Windows platform at the moment. I’m an open source fan and that makes me naturally dislike anything that won’t run on Linux out of the box. However I think I can forgive Google for that. I believe they just wanted to keep the things simple by focusing on one target platform since this is only a beta release. Also they probably wanted to get the maximum possible test coverage out of this release. In that case Windows is the only logical solution since whether we like it or not Windows still dominates the client side system software market. (and it will probably remain that way for a long time :-( )

Other than the above mentioned glitch my experience with Google Chrome has been a fairly good one. It’s easy to install and configure. I really like the wording and labeling convention used in Chrome. It’s simple and casual English that anybody can understand. Not a single technical word is used so that even someone who is browsing the Internet for the first time can easily get used to Google Chrome. Even the buttons that are usually rendered as ‘browse’ buttons in other browsers will be rendered as ‘choose file’ buttons. 

The user interfaces are pretty cool too. Chrome UI designers have clearly dumped the approaches taken by IE developers and Firefox developers to come up with their own style. It has no menu bars and no tool bars. All it has is the address bar with few more additional controls embedded into it. The address bar can be used to type in both URLs and search queries. One advantage of this organization is that it makes the browser’s main Window large so that the user can see more content without having to scroll much. But the problem is for someone who is so used to IE or Firefox, figuring out how to control the browser is going to be a bit of a pain.

In my opinion it has slightly better performance compared to Firefox-3 and IE-7. (well at least I feel that way) I have experienced frequent browser crashes with both IE-7 and Firefox-3. But I’m yet to experience that in Chrome. 

Perhaps the most enticing feature of Chrome is that every time a new tab is opened a new process is forked off by the browser. This way each tab gets its own set of resources. This will hopefully rectify most of the memory related issues experienced by other browsers. If you are a regular Firefox user you know that as we continue to open new tabs in Firefox the overall performance of the browser degrades significantly. This is because all the tabs have to share the same set of resource (memory in particular). By dedicating a separate process for each tab Google Chrome effectively deals with this issue.

I will continue to test Google Chrome in the days to come. I just started with Chrome and I will be in a better position to give a comprehensive feedback after another couple of weeks. Until then ‘good job Google’!

Wednesday, October 8, 2008

Lex It! Yacc It!

Lately I have been working a lot with the two legendary parser generator tools, ‘Lex’ and ‘Yacc’. (Well it’s actually ‘Flex’ and ‘Bison’ to be precise) To be honest I didn’t have any experience with Lex and Yacc two weeks back. But the two applications are so easy to learn and master that anyone could become an expert compiler developer in no time. Practically speaking one could start developing parsers and compilers without any prior knowledge on compiler theory or language parsing. All you need to get started is some experience in C programming. However I have to admit that some knowledge on regular expressions, context free grammars and push down automatons can make your life lot easier since that would help you better understand the syntax of the two configuration languages used by Lex and Yacc. 

Lex (or Flex) generates a C function called yylex which is capable of scanning and tokenizing a given input. The input to Lex primarily consists of regular expressions and C code segments to be executed on detection of strings that match the regular expression definitions. Yacc (or Bison) generates a C function called yyparse which accepts a sequence of tokens from yylex and parses them. The YACC input would include the productions of the language grammar and C code segments to be executed on application of the productions. 

It’s truly amazing how easy to develop parsers to accept complex languages with Lex and Yacc. The more I use it more I like it. The syntax of the configuration files are well structured and so easy to understand. I was so inspired by these two applications that I started developing my own command-line mathematics package for Unix/Linux systems. My plan is to develop something which is similar to the command interpreter that comes with MATLAB. I have already implemented support for executing simple mathematical expressions, trigonometric functions, logarithms and variables. I’m currently trying to implement the support for user defined functions. Once that is done I intend to implement support for matrix algebra and simple statistics.

The above sounds like a lot of work but thanks to Lex and Yacc I have to write only a very small amount of code. The two magic tools do the job by generating hundreds of lines of C code for me. Of course needless to say that developing something similar from the scratch would surely take months.

I’ve always wondered how come there are so many programming languages. But now I think I know the answer. It’s so freaking easy to develop parsers and compilers for a language with tools like Lex and Yacc. Once you have a language expressed in terms of a set of productions it takes only a few minutes to develop a fully functional compiler. So anyone can come up with an idea for a new language and turn it into reality in a flash. In fact I’m thinking about doing the same in the near future :-)

If you are like me and want to learn and master Lex and Yacc here is a cool reference guide. It helped me out a lot and I’m sure it will do the same for you.

Monday, September 1, 2008

GSoC 2008 ....... Done

You may have noticed that my blog has gone rather silent in the last couple of months. Well, the reason was my Google Summer of Code (GSoC) project. The final deadline was on 18th of August so I worked really hard to deliver the goods on time and finally I can proudly state that I managed to successfully complete my project on time.

The objective of my GSoC project was to implement XML schema type alternatives support for Apache Xerces2/J, the legendary open source XML parser for Java applications. Type alternatives is the answer from W3C XML schema working group, for conditional type assignment problem. This feature was first introduced in the XML schema 1.1 structures specification. Type alternatives allow a type to be assigned to an element dynamically at validation time based on one or more conditions. Conditions are expressed as XPath 2.0 expressions. Here is an example element declaration which uses XML schema type alternatives.

As stated in the above code snippet the declared type of the message element is the complex type called messageType. However the element declaration also contains a few type alternatives. These type alternatives allow the type of the message elements to be determined at the validation time. Based on the conditions stated as the test attribute values the schema validator will assign a type for the message element prior to validating its content. The expressions '@kind' and '@code' refer to two attributes of the message element. The first type alternative will assign the type called messageTypeString if the kind attribute has the value 'string' and the code attribute has a value greater than 1000.

When the schema validator encounters an element declaration with one or more type alternatives it will evaluate the test expressions one by one until an expression which evaluates to true is found. When such a matching type alternative is found the corresponding type will be assigned to the element. If none of the type alternatives match then a default type will be assigned.

My project mainly consisted of two main sections. First section of the project was to implement the type alternatives traversal support so that Xerces2/J can properly traverse an XML schema document which contains type alternatives and add the corresponding information to the schema grammar. Implementing this was fairly easy and I managed to complete it prior to th GSoC mid term evaluations. The second part of the project was to implement type alternatives validation. This was fairly difficult since I had to develop a bare minimal XPath 2.0 implementation for Xerces2/J. Developing the XPath processor actually covered a significant portion of the entire project.

My workings will be fully available in the Xerces2/J code base (even now the code related to traversal part is in one of the SVN branches) very soon. All in all it was a great learning experience as it was a great opportunity for me to learn a whole bunch of cool technologies like XML, XML schema, and XPath 2.0. I also got the opportunity to put some of my knowledge on theory of computing into action and sharpen my programming skills. I would like to give my heartiest gratitude to the Google, the Apache community and very specially to my mentor Khaled Noaman for being a very supportive guide right from the start of my project.