Posts

Showing posts from May, 2010

Wicket Framework

One of the most popular component based Java Web Frameworks is Wicket. Here is some cool links about the Wicket: 1)  http://www.viddler.com/explore/oredev/videos/61/ 2)  http://www.javalobby.org/java/forums/t105230.html 3)  http://www.ibm.com/developerworks/web/library/wa-aj-wicket/ 4)  http://wicket.apache.org/

Java frameworks trends

Image
Here is the interesting trends of three Java Frameworks (Wicket vs JSF vs Stripes vs Spring MVC) against the job market (USA): jsf, wicket, stripes, spring MVC Job Trends Jsf jobs - Wicket jobs - Stripes jobs - Spring Mvc jobs

The quality code: How to write clean Function/Method

T o write clean code is an art rather than science. From my experience at university, I did not get any course where I can learn to write clean code. Why do I bother clean code? Is it really important than solve a problem? No, it is not important than the solution of a problem but it will be pain in the future to maintain the code. For this reason, I have to write clean code to improve the quality and maintainability of the software. Here, I have presented a cheat sheet to create clean function or method: Function should do only one thing or logic [1]. Function should be small not more than 30 lines [2] Function name should be descriptive rather than short name [3] The ideal number of function arguments [4]: Zero or no argument is the best policy One argument is the better policy Two arguments are the good policy Three arguments are the worse policy More than three arguments are not acceptable. The function should be converted to a separate class If a function contains try-ca

Tips 1: Closing the InfoWindow when opening a new InfoWindow

Image
Today, I will discuss about InfoWindow of the Google MAP API V3.  At first I will show how to attach InfoWindow with each marker. As a result, when you will click a marker   figure 1                                   an InfoWindow will be displayed. Then click another marker a new InfoWindow will be displayed without closing the previous InfoWindow, see figure 1. It is a default behavior of the Google Map API V3. To do this, follow the following steps: Step 1 : Create Google MAP API V3 map object:      var latlng = new google.maps.LatLng(23.922499,91.164062);      var myOptions = {            zoom:6,            center: latlng,            mapTypeId: google.maps.MapTypeId.ROADMAP,       };       gmap = new google.maps.Map(document.getElementById("map"), myOptions);    Step 2: Create three objects. Each object contains three attributes, lat as latitude, lan as longitude, and txt as content of the InfoWindow. Create an array and insert three objects into the array. U