Sunday, December 19, 2010

XBean - open source project

Hi Everyone,
 I know i am posting in this blog after long gap. But, i came up with one best open source project called xbean . I was developing this project for past one month. I hope that this project will be useful for everybody.

I also want to share few things which i learnt after developing this project.

  1. Initially, we developed with project with rough design and started writing code(as usual). Because we thought that this project is simple and can be easy to do.

     2.  After some time, we realized that this project needs to handle of lot of requirements. So we modified the design little bit as well as source code (using generics) .

     3.  Then, we added javadoc, few refactoring (to be compatible from jdk1.5) and added extensive test cases.

     4.  Later, we thought that the project is ready for use by others. So we released it to google code using maven.

     5.  Then, we found that we can install our project in the maven central repo itself (thanks to my friend Pradeep for sharing this information). After long struggling and googling, we  successfully released xbean to the central repo by following steps mention here. This is the big achievement for this project.

     6.  Again, we found few more requirements and felt that it is difficult to add any new features in the existing code . So , we have to use some good design pattern to implement xbean.

    7.  Somehow, it strikes in my mind that xbean and filters in web.xml are doing the same job. xbean is converting one bean to other and filters are converting request to response. So, we chose Chain of Responsibility pattern .

     8.  We had modified most of code to follow this pattern (with backward compatibility) . We realized that this pattern is very useful and easy to implement .

     9.  We also realized that this pattern makes xbean project to support plugins. Yes, you can write plugins to xbean project.

Rule of thumb : Every project mush have associated with some pattern. It may be existing one or you can create new pattern. But it must follow good design pattern. Don't ever start any project without good design or else, you will be wasting lot of time in code refactoring.