Software Developer Newsletter Header
        CPTTM software developer newsletter issue #26, Kent Tong, Editor in Chief
Dear Software Developers,

This CPTTM Software Developer newsletter is to bring useful news to you, software developers in Macau, for references without obligations, so that you can do your jobs easier and better! Hope you like it. if you'd like to unsubscribe or recommend your friends to subscribe, just email me at kent@cpttm.org.mo. Old issues are available here.

Topics in this issue:

JaveRebel saves 15% of your development time at most!

JavaRebelJava Rebel is a JVM plugin that enables you to see changes to your code immediately, without redeploying an application or perform a container restart. It saves 5-10 minutes out of each hour of coding - one redeploy at a time.

The latest version is 2.0 which includes some exciting improvements such as enabling changes to method body and changes to class structure, including adding methods, fields, constructors, changing/adding annotations, and changing interfaces. It also support to make changes to configurations in Spring, Wicket and some common frameworks without redeploying.

You could take 2 minutes to watch the screencast to show how it works.

There is no free lunch, Of course. You could download 30-day free trial from the homepage . Also there is a calculator to help you decide to buy it or not.

by Tim Ma

Netbeans 6.7 released! PHP Developer shouldn't miss this!

Recently Netbeans has many improvements and releases, specially the support for the dynamic languages such as Ruby and PHP. I don't feel slow and memory-consuming in comparison to the old version of Netbeans.
netbeans 6.7

Since PHP is a dynamic and weak-typed language. I have bean searching for a good and free PHP IDE for a long time. I guess I could have done the searching and suggest everyone to try the latest Netbeans. You will be surprised for that.

Code Completion

Let's check out the code completion feature. I believe the Netbeans has done a very good job on it. You could press Ctrl+\  to do the code completion for all PHP built-in functions and classes easily, also the official documentation included. Additionally, press Ctrl + P when you forgot the parameters of the functions.

netbean - type hinting

Then what about your own functions and classes? It is not like JAVA that you have declared everything in advanced. So how Netbeans knows that variable $book is an instance of a class Book? Netbeans support PHPDoc annotation,so it recognized class variable by @var annotation or function's parameter and return value (@param and @return annotation).


Surprisingly that it also support SQL statemnt completion! Starts a string with SQL keywords and press Ctrl + \ then you you see "Select Database Connection..." option. By selecting that option, you will define your database connection in Netbeans's service perspective so you could have database's name , table name and field name completion.

netbean -sql completiong

Code Navigation

For a large development project, it is difficult to find one file in thousands. In Netbeans, the code navigation is really helpful. You could simply press Ctrl+O then a search dialog  pops up , you could search a particular class and quickly jump to the definition of the class. In similarly, by pressing Alt+SHIFT+O to search a file. Since Netbeans will index your project folder so even thousands of files you could quickly find what you want. Some more like Ctrl + Right Click on a class name to jump to the definition.

Remote editing via SFTP

SFTP remote editing feature is demanded by many people for long. Finally 6.7 has included this feature. Since there is no need to compile to deploy PHP application. Many developer will do the development on remote server. Now you could do that in Netbeans.

Also, some other features like PHPUnit support , MVC Framework support (only Symfony in this version) and version control (eg. CVS,SVN) support. I could not ask for more for this open source and cross-platform IDE.

Before you download that, you should remind that there are several bundle. If you only need to do PHP development, PHP bundle is enough and the file size is only 26MB. You could install additional language support by installing pluings

To know more about the new features and changes log, check here.

by Tim Ma

FindBugs: Find the hidden bugs for you

In general, we should find program bugs as many as we could before you deliver your program for user acceptance test. But some bugs will not be easily found after you actually run the program for a while. So Findbugs is there to help you. Findbugs is a program which uses static analysis to look for bugs in Java code. It will help to reduce the number of bugs and improve the quality of your code. Findbugs will look for the bug pattern in your compiled bytecodes. It is also open source, and used or supported by some famous companies like: Google, SUN , NSF and University of Maryland. Many famous projects also use it to test before they release their projects, like: Glassfish, JSF , SAT4j and so on. 

findbugs gui

FindBugs provides console and GUI mode, even as a Eclipse plugin. Just few simple steps you could start to use it. Run it and new a project. Select the folder for your compiled code ( zip, jar , ear or war) , and also the source folder. Then Findbugs will highlight the potential bug in your code and also the suggestion to deal with it.

Check out the simple tutorial here: http://FindBugs.sourceforge.net/manual/gui.html
Download and try here: http://FindBugs.sourceforge.net/downloads.html

by Tim Ma

The secrets to robust web applications

How to create robust web applications? A common idea is to keep checking for the bugs of the code. However, this approach will not work well as it only takes a "small" bug to bring down your whole system in certain condition (e.g., load spike). Instead, an very effective approach is to prepare for failures and try to confine them so that they won't bring down the whole system (think smoke-control door or firewall). For example, if your DB server is too busy to serve data to your application, if your application waits indefinitely, the web server thread will be tied up and many such threads may make your web application stop accepting requests from the users, so it will appear to be down to the users. Instead, a much better approach is that your application should set a time out (say, 3 seconds) and return a message telling the user try again some time later. This is the "timeout pattern" in creating robust applications.

Some other patterns are:

  • Hand-shake and fail fast: If something calls you and you don't have the resources to serve it, reject it immediately (don't let it wait).
  • Circuit breaker: If you call something and it times out, don't call it again in the future until some extended time later or a reset from the administrator.
  • Resource reservation. Reserve resource (CPU, memory, disk space, network) for your application and don't let others (e.g., those running on the same server or using the same network) take that away.
  • Limit everything (records in search results, log files, ...).
  • There are many others.
To learn more about these patterns, come to Cyber-Lab to borrow the excellent "Release It: Design and Deploy Production-Ready Software" from the Pragmatic Programmers. It won the 2008 Jolt Product Excellent Award.

by Kent Tong

Instructor Incubation Scheme in September

Since we have many participants last time. So we are going to open one more time in September. During an economic downturn, it is a good time for people to learn something new to equip themselves. So we are welcome you to become an instructor at Cyberlab. Here is Instructor Incubation Scheme to help you developer your teaching skill.  

The course fee is 100% reimbursement after you have passed the assessment. For those candidates with potential teaching ability after the class, we will consider to hire them to teach IT courses. We are looking forward to seeing you in Cyberlab! Join now: Instructor Incubation Scheme.

by Tim Ma

Want to become a part-time instructor in CPTTM?

Do you think you are a master in programing and also you want to teach people to help them become you?

Welcome you to apply to become our part-time instructor. We are recruiting instructors in software development like: Java, Spring, Hibernate or Web programing like PHP and  ASP.Net. Please email us at tim@cpttm.org.mo and tell us your name, mobile number , email and the subjects you are able to teach ( no limited in the list mentioned before )

The hourly salary rate is from MOP 200 to MOP 530 (which depends on the course difficulty and teaching skill of instructor). You don't need to have teaching experiences. We will provide the training to help on you if we think you are the potentate's instructor.

by Tim Ma

Upcoming courses for software developers

Course code Course name Start date Duration Fee Remark
CM239-08-2009-C  Introduction to Java EE Development with Spring 09-8-27 24 hours
MOP 800
  • Popular light weighted open source application framework for Java EE
  • Enjoy up to 25% course fee reimbursement
CM368-08-2009-C  ORACLE 11g Database Administrator Program 09-8-10 117 hours
MOP 4,500
  • learn to manage an enterprise scale database with a cheaper price.
  • help students to attain the Oracle Certified Administrator (OCA) qualification
CM368-08-2009-C Wicket and AJAX 09-8-20 23 hours
MOP 800
  • Suitable for Java Developer for Web Application
CM264-09-2009-C  Instructor Incubation Scheme 09-9-18 24 hours MOP 1,500
  • Become Cyberlab part-time instructor for those candidates with potential teaching ability
  • Enjoy up to 100% course fee reimbursement!

Feedbacks

Any questions, ideas or experiences to share? Contact me at 28781313 or kent@cpttm.org.moWe also have two other newsletters: CIO newsletter and Network administrator newsletter, your friends may like to subscribe.

Until next time,

Kent Tong 
CIO Newsletter Footer