Archive

Posts Tagged ‘java’

Why So Many Programming Languages?

January 10th, 2012 No comments

While checking out the search engine terms to my blog, I found an interesting one there: “why so many programming languages?” A great question indeed. If you take a look at the Wikipedia page on programming languages, you will be surprised by the number of programming languages today. To give you a hint, the languages are categorized into different sections by their first letters. When I browsed the page, I found most of them were new to me and will definitely remain so in the future. :-)

New Book: Enterprise Java Applications Architecture on VMware

November 4th, 2011 5 comments

My former colleague Emad Benjamin at VMware has just published a new book on running Java on vSphere. When I was still there, I had the opportunity to review the Chapter 5 of his book.

As many of you know, Emad is a well-known expert on this subject who has spoken at various events like VMworld and helped numerous customers. You can buy his book at Amazon or from publisher directly. Remember to bring it to next year’s VMworld for his autograph.:-)

VMware Released vFabric 5

September 15th, 2011 2 comments

As a developer, I’m always interested in latest development of middleware platforms. Yesterday came a big news from VMware: the vFabric 5 Cloud Application Platform reached GA. For those who might not be familiar with vFabric, it is an integrated suite of middleware for deploying and managing applications.

Note that despite the version number, this is the first release of the vFabric platform. I guess the version 5 may be just for aligning with vSphere 5. Also, this is a suite of products that have been there for a while.

Hub Programming Language: Does It Matter To You?

August 23rd, 2011 1 comment

There are many programming languages today, sometimes too many to choose from for a new project. The good thing is that there aren’t many main stream programming languages, so picking one is not a daunting task. And almost all main stream languages can achieve similar things, meaning any one of them will work. So in the end it’s really a matter of team preference and sometimes company policy.

Workaround: vSphere Java API with Java Web Start

August 2nd, 2011 No comments

If you are using, or intend to use, the open source vijava API with Java Web start, you want to read this article carefully.

A community user recently reported an issue in this scenario. His test application was launched via Web Start jnlp. “First, when run a single test thread everything is fine and the VM tasks operate normally.  However as soon as we kick off a second test thread while the first test thread

Java SE 7 released, finally!

July 28th, 2011 1 comment

After Java 6.0 released in 2006, it’s been 5 years during which Sun Microsystem was sold to Oracle. Today the 7.0 is finally GAed. It includes quite a few changes including small language changes as well as new and improved APIs.

The language changes are mostly small and may not affect you, for example, the switch statement now works with strings. The new try-with-resource statement, which is similar to using statement in C#, helps you with cleaner code, see the difference shown in the following

How Many Programming Languages Are Enough?

July 4th, 2011 2 comments

During last 60 some years after computer was invented, there have been hundreds, if not thousands, programming languages. If we include domain specific language (DSLs), which accorinding to Martin Fowler may include regular expression, spreadsheet, etc, the number can be even bigger, not to mention more programming languages continue to emerge.

This would be a big burden if we have to learn all of them. Luckily, we don’t have to. In fact, most of us just need to learn several most popular ones. Even better, these popular languages may look very similar in syntax. As a result,

Developing Web Applications With Vaadin

April 26th, 2011 1 comment

After Shreyas shared his experience with Vaadin in his comment on my previous post, I started to play with the web framework. As it advertises, it’s “a Java framework for building modern web applications that look great, perform well and make you and your users happy.”

Based on my experience, I think it’s a great framework that is very intuitive yet powerful. All you need to do is to write Java code in a similar way to using Java AWT and Swing for standalone applications. The minor different is

Learning Google Web Toolkit

March 28th, 2011 No comments

Google Web Toolkit is an interesting project. It’s basically an AJAX toolkit but presents itself as a Java toolkit. The idea is that you still write Java code as you would with Java AWT, SWING, and the GWT converts it to JavaScript code for you.

But why don’t write JavaScript code directly? Well, you may know Java better than JavaScript. More importantly, Java is a typed language and easier to develop a large system than JavaScript.

Using GWT for Java developers is mostly

Developing Java Client to Adobe BlazeDS

March 9th, 2011 9 comments

If you develop FLEX with Java backend, you most likely know BlazeDS already. It’s a web application running with Tomcat that exposes Java objects on the server side as services to the Flex Client written in ActionScript. It combines the best of Flex on the client side and Java on the server side. As a result, it becomes one of the most popular architectural styles for web development these days.

It’s less known that you can also develop Java code on the client that consumes the services on the server side. Check out this wiki page by Adobe on the original design. The implementation of Java AMF Client is added to BlazeDS as of July 2008.

Because I had to hack

Categories: Software Development Tags: ,

Released: VMware vSphere API and SDK FAQ

March 6th, 2011 25 comments

After working on this for weeks, I am pleased to announce the first release of VMware vSphere API and SDK Frequently Asked Questions. It includes 70+ questions and trustable answers in 6 different categories: General, Getting Started, Language Bindings, VI Java API, API Usage, Troubleshooting.

From now on, before posting any question to any forum please read this FAQ page. For the best readability, I decided not to allow comments on that page. But your feedbacks and suggestions are always important. Please feel free to use this post for comments and discussions. Based on your inputs, I will continue to enhance the FAQs.

Categories: vSphere API Tags: , , ,

Use Java Technology to Fight Twitter SPAMs

February 27th, 2011 No comments

I got quite a few SPAMs on my twitter last week. While it’s annoying to be spammed, I did pay a little attention to the spammers and noticed that their commonality: big number of tweets, 0 following, 0 follower.

These characteristics reminded me of the Java virtual machine technology to garbage collect unused Java objects. In Java, you don’t need to explicitly de-allocate memory as in C++. The Java garbage collector (GC) takes care of this for you. It looks at the objects to see if there is any reference to it. If not, it deletes the objects.

In the Twitter case, a follower is

Categories: Software Development Tags: ,

Squares Aren’t Rectangles? A Common Misunderstanding of Object Oriented Design From MSDN Magazine

December 5th, 2010 3 comments

While reading the recent Dec 2010 issue of MSDN magazine, I found an article (Multiparadigmatic .Net, Part 4: Object Orientation) with misunderstandings on object oriented design. I was surprised that the author reached conclusions like, “squares aren’t rectangles,” and “no happy ending here.” The conclusions are based on misunderstandings of object oriented design.

Let me show you what the root problem is and how to get a happy ending. After reading this, you won’t be bothered by “squares aren’t rectangles.”

What’s the problem?

As most people already know, inheritance or generalization (I prefer the latter) is an important feature of OOD. Using it effectively can lead to a good object model and concise codebase. In an inheritance relationship, a subtype must maintain “IS-A” relationship with its super type, for example, a Student type IS-A Person. I think most people are just fine with this.

Really Simple Guidelines to Write Great Code Samples

November 24th, 2010 2 comments

When a developer learns a new programming language or API, the first thing is probably to try out a HelloWorld sample. As said, real programmers don’t read documents. Although I don’t fully agree on that, it has some truth in it.

In my own experiences, I normally continue with other samples after HelloWorld one. When something is not quite clear, I check out the API reference or read some tutorials. Anyway, I am not telling you how to learn a new language or API, but trying to make a point here on the importance of code samples for the developers. In my opinion, samples are the most effective way to empower your users.

I think you would agree with me, there are too many bad samples. Here are some typical symptoms:

  1. Too much boilerplate code to a point that the code illustrating the API usage got buried. Typical boilerplate code includes extensive exception handling, GUI, logging, etc. Some samples even have a common library that could confuse your users totally.
  2. Too many API calls in one sample. You may need several APIs for a use case, but don’t aim one sample for multiple use cases.
  3. Too much object oriented. Object oriented programming is a best practice for application development. But it could confuse your developers sometimes.
  4. Dependencies on other APIs. To run the sample, your users need to install other libraries which may or may not need extra configuration or tuning. To understand the sample, users need to understand additional APIs. Extra burden, really!
  5. Of course, typical bad smells of programming which are not unique for samples. For example, bad naming, unnecessary global variables, using object attributes for passing values between methods, etc.

Now, how you can develop great samples? Besides the best practices writing great applications, you want to follow the following guidelines:

Eclipse Day at GooglePlex: A Brief Trip Report

August 27th, 2010 No comments

I attended Eclipse Day at Google headquarter today. It’s a great event packed with several great talks.

Mobile application is for sure a hot topic these days. There were several talks on mobile application development like Android Tools for Eclipse by Xavier Ducrohet from Google, Eclipse Sequoyah for Android App Developers by Eric Cloninger from Motorola, Tools for Mobile Web by Paul Beusterien from Symbian Foundation, and EMF for GWT by Ed Merks from Cloudsmith.

While sitting in the talk on Instantiations Eclipse Tools, I learned that Google bought the company 3 weeks ago. I expect Google will soon make WindowsBuilder, a famous WYSIWYG GUI authoring tool, free for GWT users, therefore further drive the adoption of GWT in competition with Flex, SilverLight.

Which Web Framework is the Best?

June 8th, 2010 6 comments

Web based applications become more and more popular. Not only normal Web sites but also enterprise management systems are adopting this to deliver the functionalities due to the benefit of zero installation on the user’s side.

There are a lot of Web Frameworks today, probably more than anyone can grasp. For each programming language, there is one or more Web frameworks that help you to create Web based applications. Choices are definitely good but may give you a hard time to decide which one is best for your project. More often than not, there is no single best one that suits all your need. In other words, you have to decide the best in the context of your problem.

What should be in the thought process to a decision?

  1. Programming language. You have to decide what programming language to use for your Web applications. With the preferred language in place, you can only use the frameworks supported by the language. This usually limits much fewer options to your list. The most popular programming languages for Web applications are PHP, Java, C#.
    The choice of your programming language is not a choice sometimes. The most rational choice is to use a programming language you and your team are already familiar with. If that happens to be C, you then want to go down your list. Learning a new programming language and a new framework can be daunting. Not long ago, I tried to learn the Lift framework based on Scala language, and found it’s not that easy at all.
    If it’s a team project, you have to find one language that all or most people are comfortable with and at least one person are good at.

Why Google Needs VMware?

May 20th, 2010 1 comment

If you think Google is a superman and doesn’t need anyone, think twice. Yesterday in its Google I/O developer conference, it announced its Google App Engine for business. The notable features include centralized administration, a 99.9% uptime SLA and heightened security. It also announced the partnership with VMware on cloud portability.

Why does Google need VMware?

In short, it’s about Enterprise. As the “for business” in the name explains, the new service is targeted for enterprises which are not really Google’s strength.

Categories: Cloud Computing Tags: ,

Top 20 Most Popular Programming Languages

April 30th, 2010 1 comment

If you are a software engineer, you might have known Tiobe popularity index of programming languages. The index is updated on monthly basis. The following table shows the top 20 most popular languages this month.

The index caught many people’s attention this month because C regained its No.1 position. Java, used to be No. 1 for years, dropped to No. 2. Although percentage wise Java is still very close to C, the declining of Java popularity can be eye-catching.

Amazon AWS SDK for Java: It’s Not Quite There Yet

April 15th, 2010 1 comment

Amazon released its SDK for Java last month. It’s a complete set of APIs that cover almost all the services from EC2, S3, SQS, RDS to SimpleDB. Overall Amazon has done a consistent job, but the SDK is NOT really object oriented. And that I think is critical for higher development productivity. 

Structure of the SDK

Before explaining why it’s not quite there, let’s take a look at the structure of the API itself. The SDK includes many packages. For each service, you find two or three packages: basic, model, and possibly util package.

In each of the basic packages you can find the two interfaces, and two implementation classes. Let’s pick EC2 as a sample here. The AmazonEC2 and AmazonEC2Async are two interfaces and implemented by AmazonEC2Client and AmazonEC2AsyncClient respectively. More methods are defined in the synchronous than the asynchronous versions with the majority of them overlapping with similar method names.

AllocateAddressResult allocateAddress()
AllocateAddressResult allocateAddress(AllocateAddressRequest allocateAddressRequest)
Future<AllocateAddressResult> allocateAddressAsync(AllocateAddressRequest allocateAddressRequest)

The first two versions wait and get you results upon return. The third version doesn’t wait and gets the result later.

Two Opposite Trends in Java Programming: Which Should You Go With?

March 24th, 2010 2 comments

Java is a static typing language, meaning you have to define a type before you can use it and the compiler checks the types for you. Some people like the static typing and others don’t. People like it would like even more into the language. Some others would prefer less typing. The rest don’t have strong opinions and are OK with both.

In the last several years, we actually see two opposite trends in Java programming: stronger typing and weaker typing. This blog analyzes in depth why these two trends happened and what do they mean for you.