Monday, January 25, 2010

GWT vs Searchability (Search Engine Optimization - SEO)

GWT has been a great tool to learn since I started. However, at the same time, I realized couple things that are not supported by GWT.




  • Multiple HTML pages linkage

  • Although it is possible to have more html pages whey you deploy, but then the history support thing will not work with those individual html pages anymore.

  • Lack of Searchability

  • Unless you create content in the hosted html file, there is no way your website will be searchable by search engines like google because they read html content. It is a common problems for ajax applications, but the usage of
    GWT is limited to only RIA(rich internet applications). Go on this link, they also talked about it.


    Possible Solutions:

    To integrate with Search Engine Optimization (SEO) on GWT, Jeff Dwyer's book Pro web 2.0 application development with GWT may give you some hints. Search Engine Optimization is on page 333 in chapter 12. Jeff talked about SEO specifically according to the example "ToCollege.net" through the book but readers should use possible solutions with more considerations based on the purpose of your web application. The Three possible solutions he talked about in the chapter were great choices, and the first option was what I came up with as well last night when I was struggling about what to do about. However, my application is a 'blog', therefore, I thought creating individual pages for each blog entry may work better.

    Ajax is a very cool web tech but as if you want your web site to be searchable, you will have to stick with html-based content at least for now. GWT will still be a very good tool to use if you are developing a browser-based application. However, do remember to always clear yourself with the purpose of your web project: is it a content based website? or is it a RIA?

    Friday, January 22, 2010

    Open a (web) business in China

    I have to claim that all the content belong to my personal opinion; I do not represent anyone and this post does not represent any group or individual's opinion!



    It is well known that China has the biggest population ratio in the world and obviously along the development, China also has the most public internet users. This element attracted many big worldwide web companies so that they all want to take some market share from this huge internet market. However, not many worldwide web companies have earned the success they expected. Reason ???? Cultural Differences!



    I was born in China and raised in China until my college time came into play. I have gone back to China for visiting almost every year since I came to Canada. During the many years I have been in China, I have traveled lots of places. Since elementary school, I have been sent to private schools away from my parents. I even attended my high school in Beijing. Therefore, I believed that the experiences I gained from China is enough for me to point out at least something (Of course I am not able to talk about all). In addition, I have been studying and working overseas for almost 5 years now and I have known and have been good friends with many people who are from different countries worldwide.



    The Society & The Population


    The biggest problem I think that causes lots of companies to have no clue what to do about the Chinese big market is that they do not understand China enough. My classmates and even some of my good friends all think communist countries like China share everything with each other equivalently. OMG, I found it was stupid! How do people think like that? It was such a naive thought. "China is a communist country which has special characteristics of China" this is how the society of China is summarized. Why is it still a communist country if people do not share everything they have? Because the nature of human already disagreed with it. Everyone is selfish, although some of people are not as selfish as others, although the level of selfishness of some people are very low, we are still selfish. China can not achieve perfectly communist because of its population, its history and many many more reasons that I personally can not come up with. Think in this way, if there were only 2 people, you and your best friend; if you are not very rich and your best friend is not very poor, you can probably share everything you have with your best friend. Can this still happen if any of the conditions stated above is changed?



    The Power & The Population


    Some people in China are very unhappy with the Communist Party in China. It is nothing weird or unusual. Because Communist Party is the only party holds the power in China, there must be people unhappy and happy with it. Since elementary school, we have had a class leader from the students in each class. Wait a minute, it maybe another difference between China and Western Countries like US and Canada. We have had a class leader since elementary school, who helps the teachers manage the class. Why can't a teach himself or herself manage the class? Reason 1, we have too many students in each class, my elementary school had 37 students in each class (well, it was the first private school in my hometown, not many people could afford at that time), other public elementary schools probably had 60-70 students in each class. My Junior highschool class had 68 students.... Reason 2, the leadership needs to be educated to students, but reason 1 truly is the main reason. Of course some students are unhappy with how the leader manages but if the leader can stand at his position, it means the people who are happy with him are more than the people who are not. Usually what happens is that this leader will lead the class for the entire 6 years at the elementary school. Will the changing of the leader improve the overall performance of the class or make a lot of differences? Most likely NOT! China is like a big class. If the power was controlled by some other unknown parties, could China have developed as fast as what it does now? Most likely NOT.


    I remember at elementary school, each grade of the school had one flag. The class which can obtain this flag indicates that it has been doing the best in the past week. How does the school determines which class gets the flag? There were checkers in each grade, and they do not check the quality of products! They check the quality of students. Those checkers also came from each class in a grade, but the checkers were not supposed to check the students from their own class. They check if students do not respect teachers and other students, if students swear, if students whisper during the class time and if students wear uniform and wear uniform correctly and so on. Generally, schools which are doing well in my hometown all operate like this. I can not summarize what it means and how it is related to knowing the Chinese culture but I believe some of you are able to come up with some thoughts about this.



    Economy and The Population


    China is well known as a country that was not very much affected by the currently bad economy. People in the US are selling their houses and cars because losing jobs caused them not to be able to afford those objects. What about in China? My parents got a new car in 2009. Popular cars in the dealers are always out of stock and people need to pay extra money to get the cars they want. To encourage people buying cars, car dealers have lowered the price of their cars in the US. This is exactly the same thing happened in China, but why there is still such a big difference? Because western people like to spend the money they will be making in the future at present, whereas Chinese people chose to save money first then spend it on something they want to buy when they have enough. It is an arguable discussion because truly, Chinese people will never enjoy as much as American or Canadian people would. However, if you look at this problem in a big picture. Because Chinese people have money to spend in the bad economy, dealers and stores will not stop selling products to consumers (they are still making money), then people who work at stores and dealers will not lose their jobs, then factories will still have to make products to feed the need from stores and dealers, then people who work at the factories will not lose their jobs either, at the end the people will still make money then start this circle again. Then think of combining how many Chinese people there are with this circle. (At here, I do not want to talk about any sensitive things such as how governments controls the economy very well. All I have talked about is what everyone can easily see.)



    The Education & The Population


    There is no need to talk about how school educate students because at the end, it is just the same thing as any other countries; plus I already talked a little bit in the "The Power & The Population" section, but let's talk about the education from parents.


    American people and Canadian people believe that Chinese people are not open enough. I certainly agree but it depends on from which way you are looking at the openness. Let me ask you this question, have you ever dated with a Chinese boy or girl? Have you ever hanged out with a Chinese person for so long that you could say that you know him or her very well? No matter what your answer is, we all certainly agree that the education from parents is very very important, but I could certainly say that the education from the parents in China is more important than the education from school. My dad always tells me "If you wanna be successful on your career, you have to know how to become a good person". There are some differences about this topic between China and US/Canada.


    For example, it is clear that eventually when kids grow big, they will all have girlfriends and boyfriends, and they will all know everything about sex. However, none of the Parents would want their kids to think about this too early because it maybe a bad influence to their studying and living, even in the US and Canada. However, maybe American and Canadian parents think they do not have to be too worried about this as long as they tell their kids "not to"! It is different in China; Chinese parents can not only tell their kids "not to" because of the population. When the population raises, the bad influence gets worse. Let's think in this way: if there were only two people and one person believes in something and trying to convince the other person to believe in it, the second person will probably believe in it or probably not, so there is an equal possibility of being influenced or not; but if there were four people and two of them believe in something and two of them don't, and if the first two people try to convince one person from other two then the other, the possibility of the second two people being influenced got much higher. You will probably say "I will never just believe something when people just tell me to", but if you think about this to a kid. Kids are much more easily influenced. That's why Chinese parents have higher responsibility of educating their kids to not badly influence others and to not be badly influenced. In other words, Chinese kids need to be watched tightly.



    The Average Salary & The Population


    When your thinking about opening a business in China, what you are looking at is the population. You might think "China has 1.5 billion people, if every of them buys my product, I will make so much money", but usually you will always question yourself "How many of them will actually buy my product?" It is well known that usually it depends on the quality and price of the product. People usually say something like "you get what you paid for" and ideally, the quality is proportional to the price. However, the ideal case needs to be broken in China.


    Chinese consumers do not make as much money as American and Canadian consumers do. At this point, I am talking about average salary. There is surely people in China making billions of dollars a year and that amount of people is actually quite a bit if you compare with the amount of the rich people at the same level in the US or Canada; but comparing to 1.5 billion Chinese people, that amount is very very small. If you are targeting at the Chinese rich people, you can skip this section absolutely but keep in mind, if you are just targeting the rich people in China, then the 1.5 billion population doesn't really make much difference for your business anyways. To state this, the amount of Chinese people who make less than average salary is much much more than the amount who make more than the average. The key to win the business in China is to know how to make the money from the poor people.


    For instance, years ago, Microsoft was almost equivalent to a monopoly in the computer operating system market. All of the computers on the market came with Microsoft windows at that time. Their windows 95 was sold for 89 dollars in the US. It wasn't expensive at all if you think about that Microsoft had invested billions of dollars on it. To many Chinese people, that 89 dollars at that time could feed a whole family for a month. If you argue that we should not talk about that period because not many people owned a personal computer, we will talk about 2009. In 2009, the average salary in China per-person is approximately 3500 Chinese yuan, which is equal to about 500 US dollars. Windows 7 home premium on Microsoft.com is listed 199 US dollars for the Full version and 119 for the upgrade version. Would you buy a windows 7 home premium if you only make 500 dollars a month? What does it the high price cause? Answer is: cracked software and even an alternative which will cost less or nothing, like linux system. Not to surprise you, a cracked version of Window7 perfessional in China is sold for about 3 US dollars, which may have problems but price is already much more important than quality in this case. but Microsoft is very smart about that, they have been selling home basic version which only costs 399 Chinese yuan (about 60 US dollars) to encourage the Chinese market.



    I just hope that my experience will give some of you a hint when you want to open a business in China. Please forgive me if the content is not very well organized and maybe even not easily understandable. I will continue to write if I have more time

    Thursday, January 7, 2010

    GWT is the way, GWT makes sense!

    Why GWT (google web toolkits) is the way? GWT is the way of what? Why do I have to mention "it makes sense"?


    Nowadays, almost everyone in the world knows what desktop applications are because owning a computer for an individual is already not so hard as 20 years ago. Especially in developed Countries, most people carries laptop computers to work, to go to school and even for travelling. As internet becomes faster and covers more places, laptop computers seem to become a little bit overabundant and too heavy to carry everywhere; Because people already can do basic daily work via the internet, such as word documents, pictures storing, and watch videos and so on. Besides these, the powerful internet search engines provides internet users with world wide information based on their own interests. Thank to those powerful web browsers. Then Netbooks came into play with their slower but smaller processors, smaller hard drive storage, and smaller memory space than most laptops. Why is that good? Because you won't need that much storage and memory space if the only thing you will need is just a web browser most importantly.


    As Ajax based web applications get more popular, more and more previous desktop application programmer started to be interested in web applications. However, the only programming language web browsers are able to understand currently is Javascript. A single threaded, non-object oriented programming language (it does allow scripters to create "object" but it is very far away from what the real OO principles can benefit). Here the question comes in, how web applications programmers can make easily reusable and maintainable code as they could with desktop applications? How can a web application become as efficient as a desktop application to the developers? (Don't get me wrong on this question. I know most server-side programming languages are object oriented.)


    GWT is tool to allow OO principles to be applied. It allows web developers program the front end of a web app in Java. Instead of compiling Java code to Java byte code, it compiles to JavaScript. It is not only easy for programmers to apply OO principles for highly reusable and maintainable programming design, but also easy to debug.


    Let's think this way. If Object Oriented Programming has been a very valuable thing to replace Procedure Oriented programming, then it should be applied to web programming as well. So far, GWT is the tool letting you do it; therefore, GWT is the way for web programming. If people usually say 'Using Object Oriented Principle to program makes more sense than using procedure oriented', then GWT makes more sense for web programming.

    Saturday, January 2, 2010

    develop GWT application with Netbeans on Ubuntu (How To Set Up)

    As I am writing this, the recent versions of GWT, Netbeans and Ubuntu are GWT2.0, Netbeans6.8 and Ubuntu 9.10


    I have been using Ubuntu linux for 6 months as I am writing this, so far I love it especially the 9.10 release. Below is the image that I just took when working on dual monitors with Netbeans6.8 open on the right side. As you can see, the fancy theme + bottom panel + linux system really make ubuntu the best operating system to my tast.



    Netbeans is an IDE which was originally built for java development; because of the great work of the developers from Sun Microsystem, Netbeans has been compatible for many kinds of development such as python, ruby, php and c++ and so on. Do not doubt about its portability, because it is written in Java. Some other IDEs are also great choices eg. Eclipse, but since I have been using Netbeans for a while on windows systems, I would like to stick with something that I am used to.


    GWT stands for google web toolkits. It is a web development toolkits written in Java by google. It complies java source code to javaScript and HTML. It makes web application development much easier for developers who are used to desktop applications. I will skip the details how GWT works and leave it for you to find out at code.google.com/webtoolkit/


    First thing you will do is to download Netbeans, GWT SDK and GWT4NB(GWT plugin for Netbeans users).

    • Netbeans can be downloaded at http://netbeans.org/ (choose the java version)
    • GWT SDK can be found at code.google.com/webtoolkit/download.html
    • and the GWT plugin for Netbeans users can be downloaded at this link (choose the right version to use, at the time I am writing this post, the correct version to use was 2.6.16).


    Install Java SDK (if not already installed, there are instructions everywhere on the internet, or can follow ubuntu help at this link),Netbeans, GWT SDK and GWT4NB.

    • Netbeans installation instruction can be found at your netbeans download page, it is easy to follow.
    • GWT SDK installation can be found at the GetStarted section on google's gwt web page.

    Next you will do is to add GWT4NB to Netbeans:

    • Open Netbeans
    • select "Tools"(on the top tool bar) --> "Plugins";
    • at the currently opened window, select the "Downloaded" tab,
    • click on "Add Plugins", find the place where you downloaded GWT4NB to then "open" it
    • click on "Install" at the window,
    now you are done with it.


    How to configure servers or anything that you need for working with Netbeans can be found on the internet. You can work with GWT's development mode when your application is under development. It is easier for debugging procedures