Monday, December 08, 2008

New Development Team

I am about to start a new development team. The team is going to be small with only 4 persons including myself. We are going to be in charge of building a fairly large application primarily for internal use but with the view of making it commercially viable.

As with all new projects I want to do things the right way from the start. Here are a few of the things I have already put in place even before the team comes on stream.

  1. Issue Tracking - I am using fogbugz to track the cases for the development. I have experimented with it for the last two months and I am impressed. I have been reading Joel's articles for years so it probably was a given that as soon as I needed issue tracking I would turn to his solution. I am also using this software as a requirements tracker.
  2. Subversion - I am in the process of setting up an Ubuntu server with websvn. I understand that fogbugz could integrate with this easily. Lets hope.
  3. Apache Continuum - For continuous integration.
As fast as I put things in place I will try to post here what I am doing. The team will start work in January of 2009 so I hope to have all the environment in place by then. In a future post I will discuss the application in more detail.

Tuesday, July 01, 2008

First IPG Launch in Trinidad and Tobago

The Baha'i community of Trinidad and Tobago launched their first IPG (Intensive Program of Growth) on June 30, 2008. This was done with a grand ceremony in the North East cluster.

In case you were wondering, the worldwide Baha'i community is involved in creating a new world civilization. The purpose of the Baha'i Faith after all, is to unite all peoples and races into one universal cause and one common Faith. To understand the purpose of the Baha'i community better this article might help: A New Vision for Humanity's Future.

The Universal House of Justice, the supreme ruling body of the Baha'i Faith, directs the spiritual and administrative affairs of the Bahá'í International Community. The Universal House of Justice has been directing the Baha'i world to create a systematic plan for the advancement of human civilization. One aspect of this plan was to create clusters by grouping certain localities all around the world. So here in Trinidad and Tobago, we have five clusters. Tobago is a cluster by itself, then in Trinidad there are North East, North West, Central and South. Each cluster is responsible for implementing the plan within their boundaries in the most appropriate manner to the inhabitants of the cluster.

As the work of the Baha'is become more systematic and the efforts of the Baha'i friends starts to show signs of progress an IPG is launched. Thus, the work of the community of Baha'is in that cluster is considered to be in an advanced stage of systematization.

This is why it is so exciting to see the first IPG launch in our country. All Baha'is in Trinidad and Tobago are very proud of the work that was done in the North East cluster and joined in the celebration. The valuable lessons learned in North East may now be used to assist the other four clusters in this country to advance.
 

The World Order of Bahá'u'lláh encompasses all units of human society; integrates the spiritual, administrative and social processes of life; and canalizes human expression in its varied forms towards the construction of a new civilization.

    (The Universal House of Justice, A Wider Horizon, Selected Letters 1983-1992, p. 66)


Early Phase of Education

A few days ago my son graduated from preschool. He's five and he wore a gown and received a certificate and everything like a real graduation. A few years ago I would have scoffed at this idea. After all a graduation ceremony is supposed to celebrate real achievement. What did the preschoolers achieve? What is the accomplishment? As it turns out, there is something to be said for having these ceremonies for the children.


During the program, the children had the opportunity to display some of the wonderful things that they learned during the two years that they spent at the preschool. Some sang, recited poetry, sang in Spanish, performed gymnastics and so on. Clearly the children were happy to perform for the admiration of their parents and the parents were happy to see their children perform.

I was asked to give a short talk at this ceremony. And this started me examining the idea of the first phase of the children's education and its impact on the rest of their lives. I have heard that the personality of the child is formed in the first five years of their lives. Basically, you are stuck with whatever you develop in those few years.

I started off by looking at the idea of education from the Baha'i perspective.

Regard man as a mine rich in gems of inestimable value. Education can, alone, cause it to reveal its treasures, and enable mankind to benefit therefrom.

(Baha'u'llah, Gleanings from the Writings of Baha'u'llah, p. 259)

In this excerpt from the writings of Baha'u'llah I found that a person is created with a measure of capacity. Education is then the process of revealing this capacity rather than filling an empty vessel. These capacities, or treasures, become evident as the education of the individual continue. We have started seeing some of these treasures in our children from just a few short years.

The children learned to read and write, do basic mathematics, Spanish and gymnastics. They also learned to interact with their peers, and to be involved in a group. Valuable lessons for their future. Isn't this enough to celebrate?

Another point from the above passage is the fact that mankind will benefit from the education of the individual. This is only true if the education of the child include spiritual education. Without a spiritual education the individual will be a monster in this society and work only for his own benefit. A person with a spiritual education however, will work for the betterment of the world.

As to thy question regarding the education of children: it behoveth thee to nurture them at the breast of the love of God, and urge them onward to the things of the spirit, that they may turn their faces unto God; that their ways may conform to the rules of good conduct and their character be second to none; that they make their own all the graces and praiseworthy qualities of humankind; acquire a sound knowledge of the various branches of learning, so that from the very beginning of life they may become spiritual beings, dwellers in the Kingdom, enamoured of the sweet breaths of holiness, and may receive an education religious, spiritual, and of the Heavenly Realm.

(Abdu'l-Baha, Selections from the Writings of Abdu'l-Baha, p. 142)

With these thoughts I had to reflect on the quality of education, both spiritual and academic, that my son receives. And that is the real benefit of this graduation ceremony. Hopefully, we can remain conscious of this over time and continue to ensure that he does receive the right education.

Tuesday, June 24, 2008

Creating Modular Struts2 Applications with AppFuse and Netbeans – A Tutorial

Introduction

I am not in the habit of writing tutorials but I found that there was a very small niche that I couldn't find adequate documentation for so I decided to write this tutorial. I recently created a new application in which I used the excellent Struts 2 framework. I used Hibernate for persistence and Spring for dependency injection. I used Sitemesh to decorate the user interface and Freemarker to create the forms.


At first the list of technologies was overwhelming and I spent more than a month trying to figure out how to get all these to work well with each other. When I came across Matt Raible's most excellent framework AppFuse it was a Godsend. AppFuse can get you up and running in a few minutes with a large number of configurations.


I found that I was able to create projects without worrying about the configuration and then customize to suit my own needs. The documentation for AppFuse is very good and most of what I write here is covered. Its just that in using Netbeans there are a few points that I had to look in the mailing list for. So its only a very small bit I have to add. You will find appfuse quickstart at http://appfuse.org/display/APF/AppFuse+QuickStart.


Setting Up the Environment

First, lets make sure that we have everything installed and configured. You will need:

  1. Netbeans 6.1 – http://www.netbeans.org

  2. MySQL 5 - http://www.sun.com/software/products/mysql/getit.jsp

  3. Java 6 – http://java.sun.com

  4. Maven 2.0.7 at least - http://maven.apache.org/



On the respective websites there are installation instructions so I will not repeat them here. However there are a few things that I would mention.

Netbeans

After Netbeans has been installed you may install the Maven plugin.

Start by opening the Plugins window. Click Tools > Plugins. In the plugins window you can update existing plugins or install new plugins. Click on the Available Plugins tab. You will see the list of plugins that are available for download. See Figure 1.

Figure 1: Available Plugins in Netbeans

Search for the Maven pluigin and select it then click Install.

After the installation Netbeans is now Maven Aware.

Maven Local Repository

Create a local repository for Maven so that the project could be built even without an Internet connection. Select a location on the hard drive and set the following in the M2_HOME/conf/settings.xml file:


<localrepository>path/to/your /local/repository</localrepository>



Creating the Application

Now its time to create a new application, and this is where the magic of AppFuse happens. As the title implies this project is using Struts2 Modular architecture. AppFuse allows many different configurations so you should visit the website and see for yourself.

1. Open a command window and run the following command.


mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.mycompany.app -DartifactId=myproject


Make sure you change com.mycompany.app to your own package structure and myproject to the name of your project. Maven creates a directory with your project name.


2. CD into the newly created project directory

In here you will find a file called pom.xml. This file is the main configuration file for Maven. Open it and edit the Database Settings. You will find these near the bottom of the file. Add the user name and password necessary for your database.


3. Run mvn

This downloads all the files and dependencies from the internet for you. It may take a long time to run. The database will be created in MySQL at this point.


4. Run mvn war:inplace

This will copy the source code from the appfuse wars into your src directory and give you a chance to make changes to them.


5. Run mvn appfuse:full-source -DrenamePackages=false

This is necessary for Netbeans to find the dependent classes. It basically installs all the source code into your application. The rename packages option is necessary if you want to keep the appfuse packages separate from your packages.


6. Now lets test your project and make sure its working. CD to the web directory of your project. Run mvn jetty:run-war.

This builds your website and starts the Jetty server. You can now open your browser and visit http://localhost:8080 to see your application. The default user name and password is admin/admin.


7. Now you can open Netbeans and click File > Open Project. Browse to the location of your new project and click on it. Make sure that you select the Open Required Projects checkbox. Click Open Project button.

Now edit your project to your hearts content.



Friday, March 14, 2008

How we learn

We continue learning all the days of our lives. Or so I heard. Now, I want to avoid getting too technical and talking about short term and long term memory and cognition and so on. But in short, short term memory, or task memory, has to do with the current task that we are engaged in. For instance, if you are cooking dinner, then the items in your short term memory has something to do with cooking. Since short term memory is limited, people tend to perform badly when there are more than one tasks occupying their short term memory. Hence, multitasking is hard.

Long term memory contains the things that we actually learn. For example, your address, how to tie your shoes, how to drive and so on. Most of us cannot remember what we ate for breakfast on the third of April 1987. That is because, that fact was not important enough to make it into our long term memory.

The trick is getting the things we need to know into our long term memory. Apparently, our brains are selective about what gets into the long term memory. So I may want to learn how to use the JPA and Hibernate and Spring and Struts 2 and a myriad other frameworks, API's and tools but my brain may decide that its not important enough to remember. Instead, I could quote word for word every line from the Lord of The Rings. Why?

Recently I started attempting to use Appfuse to create a new project that I am about to build. Since I am already experienced with Hibernate, Struts 1.x and some of the other technologies involved I thought that I would breeze through the learning phase. That was not that case. After examining why it was so difficult for me to learn this framework I realized that I never gave myself the chance to learn. I approached the task of learning with arrogance. Believing that I already knew enough.

Arrogance closed the door to learning. So I tried a series of ten minute approaches and none worked and my frustration grew and I blamed Appfuse for being too complex.

Then one day I spent several hours working on Struts 2 alone. I found it quite easy to pick up and learn. I stopped, rested did no more learning that day.

The next day I spent several hours on sitemesh. Again, quite easy to learn and use. I then spent some hours each on Freemarker, Maven and Spring. At the end I tried Appfuse again and found it quite easy to use. In fact I wonder how I ever got anything done before.

The lessons I learned is that first, don't be arrogant about your knowledge. There is always more to learn. And second, give yourself a chance to learn. That is, make time to spend on the topic, make sure you don't crowd too many different new things into the same day. Your brain needs time to convert the things you experience into long term memory.