Profile cover photo
Profile photo
jason zhang
23 followers
23 followers
About
jason's posts

Post has attachment
Promise in java
Asynchronous programming becomes popular in java world. But if you come from Javascript world, you wonder whether java has such as facility like Promise. Yes, it does. Moreover, it is more powerful than Promise. Why? Java is a multi-threaded programming lan...

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Rethink OO programming: encapsulation
Encapsulation is a important feature in OO programming.  What is encapsulation?  Here is explanation in wiki . One important feature is that encapsulation can hide some data members and function members. The The purpose of hiding is to protect object integr...

Post has attachment
Rethink exception handling
This is how I handle exception as a typical Web Developer in Java. try {    Extract 500000 $. } catch (SQLException e ) {   throw new RuntimeException(e); } You see the issue here. This is the way how developer work around the checked exception requirement....

Post has attachment
angularjs widget for domain-data.

I'd like to share one angularjs project: http://www.flexdms.com/client/index.html. This library provides a set of directives/controllers so end user can save/update/delete object of predefined class from server through a angularjs+bootstrap web UI. It also has web interface to allow end user to define the domain object definition on the fly.  You can manage your data from a web interface without developing the server. 

For more information, please check http://www.flexdms.com and https://github.com/jasonzhang2022/flexims.

Post has attachment

Post has attachment
consolidate Ajax Call
Suppose there is an ajax call which is issued each time when user is typing a character in a text box. If the end user types 10 characters, there will be 10 ajax call. However, only the result from last one is used by application. It is really wasteful to m...

Post has attachment
Dynamic Template for AngularJS
How can you use a context-dependent template? Use ngInclude <ng-include src="'mytemplate.html'"/> Here the src for ngInclude is an expression. Here I use a static template file so it is a string quoted with single quote here. You can set use an expression i...
Wait while more posts are being loaded