February 27, 2007

My first professional java project as a software developer was to build a client/server application using Java 2, Swing, RMI and Oracle database. Around 5 years back, it was a small team of 3 developers one project manager and one architect. At that time we used Forte For Java was facsinated how easily I could drag and drop swing components in a palette to build my GUI instead of the AWT way I learnt and taught my students during my Java Teaching career. However, immediately after finishing first few modules, we understood the problems of JFC/Swing components in Java 1.2 . They were so slow that a novice user could identify that and compare with a Visual Basic or C++ GUI application. We had hard time working with JTree and JTable components. But since then Java has crossed JDK 1.3, JDK 1.4 (a major improvement compared to other versions), Java SE 5 and now Java SE 6. While I am working with SWTand Java SE 5in one of my projects in office, I may get into a parallal project on Swing soon. So I thaught to prepare the same chess board using Swing and Java SE 6 and finally came up with this entry. You may compare this with the one that I prototypes using SWT as a practice. To my understanding while both SWT and Swing has its own places, Swing would be a better choice for my next java GUI development due to its intuitive, easy to use API. You dont any java IDE for the program I am going to show you today. However, for advanced GUI design purpose my favorite would be Netbeans 5.5 and as I want to continue using MyEclipse where most of my java projects are configured, I downloaded Matisse4MyEclipse in it.

Get tight and follow the steps!

Make sure you have Java installed. I installed Java SE 6 in C:\programs\java\jdk_6

Install Ant 1.6.5 altough you may use command prompt if you dont want to use Ant.

February 21, 2007

Here I provide you the step by step instructions that I carried last night to develop a web site for an IT professionals’ association in California, USA. They need a good news/content management system, a very good forum software and some sort of community/networking features other than regular static/dynamic functionalities that might be developed later phase by phase. I know Joomla (emerged from Mambo) PHP framework or CMS has many great extensions that I can use in developing web 2.0 sites. Although it has been long since I last used PHP, joomla made my work easy by mostly limiting me in configuration and installation efforts to develop a site. So I thaught to share it with you here. I wish there would be something similar in Java with all the extensions and easy to install features!

Pre-Requisite

A domain hosting space where you want to host your site. I chose hostmonster as they have support for PHP, MySQL, Fantastico, Joomla, SMF and many more.

Steps

Install Joomla! I logged into my hostmonster control panel, used Fantastico to install Joomla 1.0.12 in /cms directory. Keep the MySQL database, username and password handy with you as these will be needed in later steps.

Dont use the GZip compression output, uncheck that option in the wizard page.

Give the same MySQL database name, user name and password that you used for joomla installation. You can find these information in configuration.php file under your domain’s /cms directory. The 3 variables to check for the values are – $mosConfig_user, $mosConfig_password, $mosConfig_db .

Once you finish installation, you should get a success message and install.php file should be deleted for security reason.

Unzip the community builder zip file in your local hard drive. You will need cblogin.zip, comprofiler.zip, mod_comprofilermoderator.zip and mod_comprofileronline.zip files from this location in later steps.

If you have followed the steps properly, you have enabled your site for visitors to register/login using CB Login form, roam around and give entries for the various news/polls/blogs entries, submit weblinks, do social networking with like minded community members etc. Your users should be able to roam around the joomla cms pages through the link – http://www.yourdomainname.com/cms and the forum either through http://www.yourdomainname.com/forum or from CMS home page’s Forum link.

February 15, 2007

I have worked with AWT, Swing and SWT in different projects. I was involved last 2 years mostly on web applications and hence after joining Philips, I got a chance to work with thick clients again. Here I developed a simple prototype for SWT beginners with step by step instructions to develop a chess board using SWT and 3 different ways to setup environment, compile and run it. Hope you will enjoy!

Make sure you have Java installed. I installed Java SE 5 in C:\programs\java\jdk_1.5.0.7

Install Ant 1.6.5 altough you may use command prompt if you dont want to use Ant or even better if you use Eclipse which already has Ant functionalities to work with Ant. I installed Ant at C:\programs\java\apache-ant-1.6.5

Create project directory at c:\workspace\SWTBoard either manually or using Eclipse New Java Project.

Download SWT jar file from Eclipse web site – http://www.eclipse.org/swt . If you already have Eclipse installed in your machine then, you will find the JAR file inside $Eclipse_Install_dir$\plugins directory. I am using SWT 3.2.1 for Windows.

Copy the jar file to a suitable directory for easy reference. I copied the org.eclipse.swt.win32.win32.x86_3.2.1.v3235.jar file (or swt.jar if you have downloaded from Eclipse web site) in C:\workspace\swtlibs directory.

Extract swt-win32-3235.dll file inside the SWT jar file and copy it into the same directory.

To compile from command prompt, double click javase5.bat file and issue the following command: javac com/chess4you/board/SWTBoard.java

To run from command prompt, issue the following command: java -Djava.library.path=C:\workspace\swtlibs com.chess4you.board.SWTBoard

To compile using Ant, issue the following command: ant compile

To run using Ant, issue the following command: ant run

To compile/build the project using Eclipse, you have to first add the SWT jar file in your project classpath. To do so, right-click on your project in package explorer and select Properties->Java Build Path->Libraries->Add External Jars… and add C:\workspace\swtlibs\org.eclipse.swt.win32.win32.x86_3.2.1.v3235.jar . Now you should be able to build the project selecting Project->Build Project .

To run the project using Eclipse, select Run->Run… ->Arguments and in VM Arguments text area add the following entry: -Djava.library.path=C:/workspace/swtlibs

You may also use the Ant build file (build.xml) from Eclipse by double-clicking on it and running the specific targets (compile or run) by right-click on the target and selecting Run As->Ant Build.

February 9, 2007

SQA Bangladesh took an excellent initiative to interview the mentors of software industry in Bangladesh and podcast those through Meet the Mentors program. Listen to their first podcast(MP3) session at:

This session is with Khandakar Asif Hasan, Director at Spectrum Engineering Consortium Ltd who shared his valuable insights on the strategies for development of software industry infrastructure. In this interview he touched the areas of software development life cycle process, proper training of human resources to build up core professionals in this field, the issue of internship, current Bangladesh Government policies in IT sector, modifications that need to apply to grab local software markets, essense of sustainable software development community, major problems of our software industry by comparing with the neighboring country India. He emphasized on collaboration between software companies and sharing knowledge, tools between each other to guide our software development community with a successful new dimension. Overall this podcast session tries to visualize the milestones and problems of software industry through the analytical portray of Khandakar Asif Hasan with his mission, vision and experiences of journey in the software industry during more than a decade.

I was lucky enough to get Asif Vai as mentor in my software engineering career when I joined Spectrum Engineering Consortium Ltd at 2001. Those who have worked with him, have the appreciation for both his architectural vision as well as engineering approach to solving any (non technical) problems. Layered architecture, design patterns, process centric software development approach, importance of good document writing, team work, knowledge sharing are only a few of what he instilled in our team. He understands the industry trends and from a bird’s eye view can tell which one is appropriate to adapt with and which one should be only studied and left in the buzz. We need more mentors like him in our software industry. I invite you to go through the whole session and share your feedbacks with me.

Recently I worked on JESS, stands for Java Expert System Shell, in Philips Motiva project which is a remote patient monitoring platform. We use Jess for decision making support in Motiva to make it an intelligent system. I can’t think of learning JESS without reading its creator Ernest Friedman-Hill‘s book JESS In Action. Ernest is also a moderator of JavaRanch. There are alternate rule engines available – Mandarax, QuickRules, Drools, ofbiz, JRules, Haley Rules Products, Common Knowledge.

While working with JESS, I have developed a sample prototype to use the basic language syntaxes of JESS. The program is as follows. It shows usage of basic Jess language sytanxes, if/then/else, while consturcts, bind, list etc. The programs gives an overview of chess borad game and its pieces.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; this is jess
;; working on chess
;; i hope its
;; not quite a mess
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(printout t ”
=========== Start of Jess On Chess. ===========” crlf)

;; what is chess?
(printout t crlf
“**** What is Chess?
Chess is an abstract strategy board game and mental sport for two players.
The object of the game is to checkmate the opponent’s king.
This occurs when the king is under immediate attack (in check) and
there is no way to prevent it from being captured on the next move.” crlf)