The Road To Java Certifications 1

August 22, 2009 § Leave a comment

In the dates 08/2008 & 06/2009 I prepared and obtained some Java certifications, I got the Sun Certified Java Programmer (SCJP), the Sun Certified Web Components Developer (SCWCD), and finally the Sun Certified Business Components Developer (SCBCD). In this post I will talk about this experience and how I prepared for these exams.

Why Should I get certified?
This is an important question that you have to answer. For me getting a certification was important for two reasons:

1. Its a paper proof for recruiters that you know the technology.
2. You will gain a deeper understanding in the technology.

The most important is the first point, the IT market is full of competition, if you want to find a good job you have to show that you are better than others, and certifications help doing so. To apply for a job you normally send your CV to recruiters, which in turn filter good CVs from not that good CVs based only on what they see in your CV, your goal is to get your CV pass this filtering process and get called for an interview (where you will show them how you Rock).

Keep in mind that even if you have a certification it doesn’t mean you master that certification technology, working experience is important too. In the end Sun Microsystems will not make passing a certification exam impossible, this is business and if nobody is going to pass certification exams Sun will not sell exam vouchers. So keep in mind that having a certification is good, but not having a certification doesn’t mean you are not good. Bottom line: experience beat certification but certification is a plus.

SCJP Preparation
This is the first serious certification exam provided from Sun Microsystems, actually you can take another exam before SCJP named Sun Certified Java Associate (SCJA) in which you will get questions like:

Q1. Java is a _______________ language. (A)Procedural, (B)Object Oriented, (C)Query.

So get started from SCJP and leave SCJA for marketing people that want to show their colleagues they know Java. Now lets get prepared for the SCJP exam.

Read the SCJP exam objectives
It’s very important to know what are the exam objectives in order to know what to study, and what not to study.

Study Book
The Best book is the Sun Certified Programmer for Java 5 by Katherine Sierra & Bert Bates known as K&B, this is the only book you will need to pass the exam, don’t waste your time reading from other books. The book is well structured, and provides a group of mock questions at the end of each chapter that will help you better understand the concepts. I read this book twice and I felt almost ready for the exam. (WAIT!! you need to do other stuff).

Note: When I did the exam it was for Java 5, however future versions of Java will be available for sure, so you may find the same book for Java 6 (or even Java 11g. Will Oracle name the next version of Java like this?).

Mockup Questions
Its is very important to exercise on mock questions, I found the java inquisition exam simulator very helpful. It seems that inquisition questions are a bit tougher than the real exam, so if you score 70% in inquisition you will for sure pass the real exam (unless you got the 70% by luck). In addition the following links contain some useful questions:

Java Beat
Java Ranch Mock Questions

You Don’t Understand Some Stuff?
If during your study you have some questions and need answers, visit the Java ranch forum, subscribe and post your questions there, you well get almost immediate feedback, they will help you a lot, I may answer some of your questions too 😉

How Much Time Will I Need?
I hate this question, but its always asked. The answer is IT DEPENDS on you, if you have a good experience in Java and you are a fast learning guy you could prepare for the exam in 1 week, you may even pass the exam without studying if you are really good in Java (but do you have to Risk?).

My suggestion is to read the entire K&B book provided above, and do the mock questions after each chapter, and based on your results decide wether you are ready or not.

How to Buy the Exam and Schedule it?
I recommend visiting the SCJP FAQ page in the Java Ranch, you will find many useful information about how to buy the exam voucher, schedule the exam with a prometric center, in addition to a group of links to online mock questions, and other SCJP experiences and success stories.

One final thing, if you search on the internet you will read a lot of successful stories about people who got certified, you will read that John studied 3 days only and got 100%, Mary studied 2 months, half an hour a day and got 98%, yes it is possible but keep in mind that people tend to share their success stories and hide their failures, reading a lot of successful stories around doesn’t mean that everyone passes the exam. You have to prepare well and do your best.

Wish you Good Luck, in your own preparation.

NextThe Road to Java Certification 2

Advertisements

Safari or Firefox ?

August 20, 2009 § Leave a comment

This browser war is between Mac users, should I use Firefox as my browser or Safari? Mac users disagree on which is better, however (fortunately) we all agree on one thing (Internet Explorer S**KS). Once I bought my first Mac I didn’t even considered Safari I just downloaded Firefox and used it, this happened because I was coming from a Windows platform and Firefox was my browser so I kept using my nice old browser.

However when Apple Safari 4.0 beta was available, I said I should give it a try, in the end I can’t judge about something without using it, besides trying will not kill me, so after using the beta version I liked everything about Safari except the tabs position which was too much on the top, however when Safari 4.0 was released the tabs came back to their original place and now I was satisfied with the design too.

Startup Time
For this test I restarted my MacBook to be sure applications are not cached, when I launched Safari on my MacBook its startup time took 1 bounce on the Dock, Firefox took 8 bounces, there is a big difference in startup time which I can’t explain, may be Mac OS does something for safari on startup (I don’t know). After closing both applications and trying to open them again they both took 1 dock bounce.

CSS Rendering
For this test I used the CSS benchmark test. Safari completed it in 8 ms versus 39 ms for Firefox, without closing the page I did the test again, Safari time was still the same while Firefox took 22 ms. Since there was a change I decided to repeat it till Firefox gives me a constant result however I could not reach this point, but the fastest result was 12 ms.

SunSpider Javascript Benchmark
This benchmark tests the core JavaScript language only, after completion it provides a detailed report, I took in consideration the total time to complete the test, Safari took 727.6 ms while Firefox took 1404.6 ms. This test allows you to compare the results of each browser and Safari was 1.93x as fast.

Peacekeeper Javascript Benchmark
Although in the previous Javascript test Safari beat Firefox, I decided to try other Javascript tests, I found Peacekeeper. Safari scored 3153 points while Firefox got 1432 points. which makes safari 2.2x times faster. However it was mentioned in the website that Chrome 3.0.195 was even faster than both Safari and Firefox. (I will target Chrome in another post).

Acid 3 Test
This is one of the famous browser tests used to assure that a browser conforms to web 2.0 standards especially for DOM and JavaScript, Safari got 100% while Firefox got 93%.  (Man I am starting to love Safari).

V8 Benchmark Suite
Ok one final test to be more sure of my results, I found this V8 benchmark website, again Safari was faster than Firefox with 1894 points versus 270 points only. which means Safari was 7x times better than Firefox. is that possible!!

Summarizing the results of the different tests in the table bellow, its clear that on a MacBook machine, Safari beats Firefox in everything related to performance.

Ok this was performance but this is not the only factor for choosing a browser, the nice thing about Firefox is the huge number of plugins available, which allows you to extend your browser and add new functionalities, however – for me – the only plugin that I used on Firefox was Firebug which is a great tool used by many web developers to navigate the DOM of an HTML page, test CSS styles and find JavaScript errors. The pleasing information is that Apple understood this need for web developers, and provided a Develop menu similar in its functionality to Firebug, this menu is hidden by default but you could show it from the preferences panel.

This was my revision of Safari Vs Firefox, and I repeat, it was done on an MacBook, so performance results may be different on a PC machine. I will try to make a similar comparison between Safari & Chrome.

What about Internet Explorer? Man please, Internet Explorer is the worst browser in the universe, its ugly, slow, and doesn’t respect web standards, the only reason its out there is to make Software Developers explode of anger because they have to test their web applications on it since it has a market share of nearly 68% (but thanks God it is continuing to lose market). So I will be waiting for the day IE dies…

NextThe Road To Java Certifications 1

Do People Talk About You?

August 19, 2009 § Leave a comment

If you are marketing some product over the World Wide Web, or doing some other activities – for example blogging – that can be subject to internet users judgment, its important to know if people are talking about you, if yes if they are talking positively or negatively, and even in which conversations you are involved. These are important information that you need to know to best accomplish your cyber activities. In this topic I provide some tools that will help you figure out these information.

Google Alerts
Google alerts is a free services offered by the internet giant, which notifies you by email or as an RSS feed about a specific query or topic you provide. For example you can monitor who is talking or mentioning your name all over the web. Using this services Google will send you periodic emails (daily, weekly or by occurrence) pointing you to the sites that are talking about you, there are six types of searches (News, Web, Blogs, Comprehensive, Videos and Groups).

Note that you can use Google operators for the search terms, for example to know if someone has provided a link to your website (www.you.com) you could use this search term (link:http://www.you.com).

Twitter
Twitter is a social website. This is a perfect place to listen to what people are saying about your company or product, you can even subscribe to an RSS feed of the search results. For example in 12/08/2009 my blog host (Weebly) was down and I couldn’t publish my new updates, trying to figure out what is happening I searched the Weebly keyword  and got those results shown below, where everybody was complaining that the service was down.

If you have a major product, and want to know what people are thinking about it, you could simply type your brand name in twitter and get real time information, or you could type your competitor product names and see if he is getting more positive feedback than you.

Technorati
Technorati is a blog search engine that lets you find out what people are saying about you within the blogosphere, The results can be available in RSS format, so you can subscribe to the various search results as well.

These where free services, there are other commercial tools that allow you to monitor yourself on the web, and show some analytical data the most popular are Radian6 and Trackur.

NextSafari or Firefox?

The Perfect Software Development Team

August 17, 2009 § Leave a comment

An important question that needs an answer. What is the perfect software development team? what is the perfect number of developers in a team? what kind of developers should they be? how should it be organized? of course this depends largely on the project size, in this post I target the perfect team for small or middle sized projects, so please don’t email me telling me that you can’t develop Windows XP with only 10 developers.

But why do we need a team? If I work alone I will prevent all the overhead of communication between my team members, I will not waste my time explaining things to others, and I will have control on the whole project. My answer is, if you can do everything alone then go ahead, you don’t need a team and you will save time and money. Unfortunately in the real world there are deadlines to respect, you need many and different skills that are impossible to find in only one developer, and finally most projects are too large to be developed and tested before their deadlines by a single developer.

Ok, so you decided that your project needs a team… Lets get started. The first ingredient for the perfect team is its structure, there are two common team structures as Mike Gunderloy suggests in his book Coder to Developercommunity of equals or hierarchal. In a hierarchal structure there will be a Manager that will guide the team, an experienced developer that controls a bunch of non-talented developers telling them what to do and how to do it, this structure is widely used because managers think (and I say managers not I) its more profitable, since they will extra-pay only the one talented developer, while the other developers will get low salaries. In my opinion this is the most stupid, unproductive, unpredictable, non robust, risky, and non profitable structure for the following reasons:

1. Although by this structure you have more man force in your team, but this doesn’t mean you will be more productive, yes we are building something but building programs is not like building houses. From the book The Mythical Man Month Frederick P. Brooks Says:

“In one of their studies, Sackman, Erikson, and Grant were measuring performances of a group of experienced developers. Within just this group the ratios between best and worst performances averaged about 10:1 on productivity measurements and an amazing 5:1 on program speed and space measurements! In short the $20,000/year programmer may well be 10 times as productive as the $10,000/year one”.

Note that this is due the lack of talent and the overhead needed for communicating and organizing the large number of programers, which is much smaller if your team consists of sharp developers. remember that its better to build the system with as few minds as possible.

2. Software quality. Unfortunately management quality measures are applied by looking at the software from the outside (the running application), but what about the quality of your code? what if you need to add a new feature? will it be easy? will it introduce new bugs?  if you modify one module will this change cascade to the other modules? This depends on how talented your developers are, great developers will write modular code, respecting Object Oriented principles, while non-talented developers will write Spaghetti Code, full of bugs, and difficult to maintain.

3. High Risk. The hierarchal structure is used to save money (as managers think), which leads to hiring low salary non talented developers, this introduces a high probability that they will dismiss as soon as they find a better job with a higher salary, which if happens, and it will happen. You will have to hire a new developer, re-explain everything to him and start all over again, and since the project code sucks is crappy; integration time will increase. What if it happens 10 days before your deadline?

These are the major reasons why I don’t advise the use of hierarchal structure, which sadly its the most adopted structure. The better choice (in my opinion & experience) is the community of equals which I prefer calling it a community of talents. In this structure you have a few number of talented, experienced great developers doing the job of 30-100 normal ones. In this structure its advisable to have different skills, for example a talented back-end developer, a talented front-end developer, a talented tester and so on. By this you can split your project to layers, with each developer working on his own layer. the benefits of this approach can be summarized as follows:

1. Talented developers will write better, robust, almost bug free code. Code will become Lasagna Code instead of  Spaghetti Code (Lasagna is structured in layers, Spaghetti is a mess, got it?).
2. Orthogonal code, where modifications in one layer will not effect other layers, your modules will be loosely coupled.
3. Versioning conflicts will decrease since there will be no two developers working on the same file, and this will save a lot of time.
4. Communication & organization time will decrease, meetings with the whole team participation will be possible.
5. Finally since its a community of equals work will be even more fun.

This was about the team structure, but what about the number? this depends on your deadlines, my suggestion is to identify the major layers of your project, for example a typical java web application project can have the following layers:

1. Persistence & Business layer, developed in EJB3
2. Presentation Layer, for example in HTML or Flex 3.
3. Control Layer, coordinating the communication between the presentation and business layers.
4. Reporting module, which generates .pdf reports, for example using Jasper Reports.

Then depending on the deadlines hire an adequate number of talented developers for each layer, having in my mind that performance will not be multiplied by the number of developers since as more developers you add for each layer, the more communication time you will need.

Yes! you are right, where the hell is testing? Testing is something that every developer will do alone. Every developer will be writing his own unit tests for the modules he develops, however integration testing and stress testing testers can be added to the perfect team. Finally a team manager with programming experience is needed to interface between his team and customers.

This is my opinion about how I would structure and choose my perfect team, In this post I avoided as much as possible the term experienced developer and I used talented developer because having a 10 years experience doesn’t mean that you are a great developer, great developers are rear and difficult to find, they are those who understood what a C pointer is the first their professor explained it, they are those that can solve whatever problem you assign them, they are those who can switch from C++ to Java in 3 days, and this can be achieved by talent not experience, even though experience is helpful, in the end you need developers who are ready to learn new stuff if needed not people who will solve every single problem using a PL/SQL procedure because they passed the last 10 years doing only that.

NextDo People Talk About You?

The Power of Apple Multi-touch Trackpad

August 16, 2009 § Leave a comment

Everybody knows what is a computer trackpad, its that sensitive surface on your laptop that allows you to move the mouse cursor, click, double click, and sometimes scroll vertically and horizontally. In other words its that device used to provide a real mouse functionality.

I surfed the web searching for what a PC trackpad offers, and I got the following list:

1. Move the mouse cursor.
2. Effect single clicks by tapping on it or pressing the left button.
3. Effect double clicks by pressing the right button.
4. Scroll vertically by swiping on the right scroll strip.
5. Scroll horizontally by swiping on the bottom scroll strip.
6. Some different actions by tapping on one of the four corners.

And its exactly what a real mouse can do, move, click, and scroll. But what about this trackpad made of glass?

This is the latest Apple answer for what a trackpad can be and do, It is amazing how many things (Gestures for Mac users) can be done using this awesome piece of engineering. The great thing is the introduction of intelligence, this trackpad understands your finger gestures, depending on the way you pinch, rotate, or swipe and the number of fingers you use, this is a revolutionary idea that changed the way a trackpad is conceived, using this trackpad you can do the basic stuff I mentioned above, in addition:

1. Right click by tapping the trackpad with two fingers.
2. Scroll over the screen by moving two fingers on it, for example for a vertical scroll move two fingers from top to bottom.

3. Rotate things (images, .pdf pages) by rotating two fingers on the surface of the trackpad.
4. Zoom in and out, by making a pinch gesture, this is handy when you want to zoom in a .pdf page, or an image.
5. Make a one page scroll if you swipe vertically using three fingers, I use this to move fast between .pdf pages.
6. Navigation between different images, tabs, or forward/backward operations in safari by swiping with three fingers horizontally, this gesture is overloaded in many applications, for example in Adium (a chat program) I use it to switch between conversations.
7. Show the desktop by swiping with four fingers to the top.
8. Do an Expose operation by swiping with four fingers to the bottom.
9. Switch between applications by swiping with four fingers left or right.

Finally you can even input chinese characters using the trackpad, its clear that apple has expanded the number of things you can do using a trackpad, and this is thanks to their multi-touch technology first introduced in the iPhone. You can even customize your trackpad gestures using some applications one of them is named Multiclutch.

This is one of the reasons why I love Apple products.

Next: The Perfect Software Development Team

MacBook Bluetooth Disappeared

August 13, 2009 § Leave a comment

Today I faced a common Mac problem, I have lost my Bluetooth device, It disappeared from my menu bar and from my preferences pane, I didn’t panic because I remembered a friend of mine faced the same problem, however I didn’t remember how he managed to solve it, so I started with a machine reboot but it didn’t work, so I googled and found a group of suggestions:

VMware Fusion may be hiding your Bluetooth
I was pretty sure this was the problem since my VMware starts automatically as I boot. What I understood is that the Bluetooth device may disappear from your Mac because its being used by the virtual machine operating system, for example Windows XP, in other words only one OS can see your Bluetooth, so I cmd + Q’ued VMware but Bluetooth was still missing, I tried a restart but no Bluetooth (Damn it!).

Delete the file Library/preferences/com.apple.Bluetooth.plist
I didn’t find this exact file, I found a file named com.apple.Bluetooth-xxx.plist where xxx was a sequence of characters and numbers, I think this was a temporary file that got missed up somehow (don’t ask me how, It wasn’t me), after deleting this file I restarted the MacBook again and the bluetooth was still not there, so I moved to the next suggestion:

Repair your disk permissions
To do this I Opened Disk Utilities, please don’t ask me where it is, use spotlight, anyway after opening Disk Utilities I selected Macintosh HD and clicked Repair Disk Permissions, this operation took around 5 minutes, I restarted my MacBook AGAIN and this time Ta Daaa bluetooth is back.

I don’t know what the hell caused my Bluetooth to disappear, but its a common problem in the Mac community, and I didn’t like restarting my MacBook four times in 20 minutes. The strange thing is that almost every mac update contains something related to Bluetooth, may be this is the issue they are trying to fix, if this is true there is only one thing sure This Problem is Driving Mac Developers Crazy.

Oooh In case you are a PC users don’t send me an email … I WILL NOT SWITCH

Efficient Software Development (2/2)

August 12, 2009 § Leave a comment

In my previous post I discussed how we could write code more efficiently, and focused on the importance of keyboard shortcuts, in this second part I will give additional tips to optimize the remaining steps I mentioned. Again the steps were:

1. Write Some Code.
2. Compile and deploy the source code to the application server.
3. Start the application server.
4. Open the browser and test the new modifications.
5. Its not working, I say bad words to my screen.
6. Stop the application server … and go back to step (1).

What’s next? what about automatic code generation? there are many pieces of code that can be generated automatically by the IDE, this saves a lot of time, and prevents the introduction of bugs (we are humans and we do mistakes). Every Java programmer knows what are Java beans, they are Java classes which adhere to certain coding conventions, one of these conventions is to provide a getter and a setter method for accessing it’s properties, Eclipse allows you to generate those methods automatically, another example is the implementation of equals() and hashCode() methods inherited from theObject class. why should we write them by hand when Eclipse can do it?

One final tip is the use of column editing, many programmers don’t know what is column editing, however now that it has been included in the final version of eclipse (Galileo) there is no more an excuse for not learning it, check this video.

Compile and deploy

For Java programmers it happens that you compile your code, create a .war or .ear archive containing your classes, place it in a deployment directory under your application server. This is a simple workflow that consists of compiling, generating a file, copying the file to a specific directory, can’t we automate it? of course, we can use an ANT script, if you don’t know ANT its time to for learning.

Sometimes you deploy the whole application just to check a small modification, my suggestion is to make as much modifications as possible before deploying, if you have a good project architecture that includes unit tests, things could become more efficient if you use out-of-container testing (I use it for testing EJB3 applications); you will write code and then lunch a bunch of unit tests to test your code without the need to deploy the application.

Start/Stop the application server

Many application servers can update deployed web apps with no need to restart them, (Hot deployment for JBoss user), however even in these application servers you encounter situations where you are forced for a restart, so its advisable to choose a light weight application server for development if possible, for example if you have a .war application and no EJB’s under JBoss in a production environment, you could use Tomcat instead of JBoss in your development environment, why? because to start JBoss you will need an average of 50 seconds, however if you use tomcat it’s something around 15 seconds, 30% faster. Repeat with me Time is money, Time is money, Time is money.

Open the browser and test the new modifications

So you deployed the new application, and you are ready to test if everything is working fine, which means you will do the following steps:

1. Switch to the browser window (please tell me it’s Safari).
2. Type the web application URL http://localhost:8080/MyKillerApp
3. Do some clicks to reach the intended page.
4. Start testing the modifications you did, and check your logs.

Even in these operations you are losing a lot of time caused by application switching (the browser and the IDE). The best solution is dual monitor mode, a programmer SHOULD have two monitors not one, they are so cheap those days that you can find a 19 inch screen with less than $120, by using two monitors you can open the browser on monitor A, and the IDE on monitor B, this will save window switching time, switching headaches, and save the keyboard buttons (alt + tab or cmd + tab). Remember that in a normal situation you will be switching between windows even for checking the generated logs (WHAT? you don’t use logging? are you crazy!? please read this). Finally I would advise to bookmark your main application URLs to prevent writing them every time.

Those where my tips for being more efficient, note that following Object Oriented paradigms such as, DRY (Don’t Repeat Yourself), Encapsulation, Polymorphism, and common design patterns will all lead to better code that needs less time to maintain and debug.

Next: The Power of Apple Multi-touch Trackpad