123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computer-Programming >> View Article

Using Gwt For Json Mashups

Profile Picture
By Author: mayur aegis
Total Articles: 64
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

Java developers land up with mashups while meeting new codes during Java Application Development. Mashups enable Java developers to develop quick and powerful applications probably if they have correct tools. GWT can be integrated with other web applications that expose data in JavaScript Object Notation (JSON) format. This article describes more about it.
JSON, a subset of JavaScript is cool be also dangerous in some ways. Being an executable code it is vulnerable to variety of attacks. While GWT development or Java Application Development if JSON is used then Java developers should stay aware of these risks and apply countermeasures.
Basics of JSON: It is a syntax used by JavaScript to define data objects that is compatible with other languages. For more details you can just explore json.org. JSON offers several benefits out of which one is that JSON data can be parsed by browsers by simple calling of eval function by JavaScript. There are several methods that can be categorized by how developers fetch the data.
Techniques are used to make mashups possible while they can also be created using server-side ...
... proxies.
High-level Design: Google Data API can be used for fetching information. Its GData provides interfaces like XML, JSON and JSONP which allows maximum flexibility for developing apps. GWT apps are written in Java so there is a phase where Java source is compiled into JavaScript by offshore java developers. One of the optimization that is performed is code obfuscation which makes output smaller and quicker to load. Disadvantage of this is that the output code is unpredictable which makes difficult to callback function name to a JSONP service.
Most effective technique used by offshore java developers for such cases is “Function Bridge” which involves creation of handle for obfuscated function and then copied to well-known variable name in the namespace of JavaScript. During invoking of function by outside JavaScript code the actual invoking is done of real function via the copied handle.
This rough design would help after considering all those points discussed above:
A unique token is assigned with each request for Google Data JSON.
With the use of GWT’s JavaScript Native Interface a new callback function for each request is created on demand and this token is included in the name of function to make it unique.
Callback is a function of JavaScript closure over the token which is passed to the inner function during the invoking of callback.
For each callback same inner function is used for making it use the token for dispatching the response data to the appropriate GWT code.
“Moving Parts” of this strategy:
To handle responses that are incoming from the Google Data server is single dispatch method to be used in GWT development.
The next method is to use JSNI for constructing the function closures and initiate the Google Data request.
At last during the clean-up phase all callback handles should be removed to avoid cluttering of JavaScript namespace. To prove the final API a single class containing all the key parts can be implemented. Some of the key requirements to make it work are:
Abstraction of the dynamic to be inserted behind a method call
Need to handle bookkeeping of tags
Need to provide a method for generating and reserving a call-back function name

For More Information:- GWT Development | Java Application Development

Total Views: 216Word Count: 542See All articles From Author

Add Comment

Computer Programming Articles

1. Which Are The Best Java Coding Classes In Bhopal?
Author: Shankar Singh

2. Warehouse Management In Zambia: Essential Features To Look For
Author: Doris Rose

3. Ecommerce Web Design And Development In Melbourne With The Merchant Buddy
Author: themerchantbuddy

4. Why Website Maintenance Is Crucial For Business Success
Author: Yogendra Shinde

5. Boost Your Business With Smart Invoice Pos Software In Zambia
Author: Cecilia Robert

6. How Stablecoin Development Ensures Stability And Security?
Author: Michael noah

7. Công Cụ Tính Chiều Cao Chuẩn Từ Minbin Tool: Đo Lường Và Cải Thiện Chiều Cao Hiệu Quả
Author: KenJi123

8. How To Make A Courier App For Courier Delivery And Tracking Service
Author: Deorwine Infotech

9. Reputation Management In The Digital Age: Protecting And Enhancing Your Law Firm’s Image
Author: jamewilliams

10. What Features Should I Look For In Wordpress Ecommerce Plugins?
Author: Rocket Press

11. Staying Updated With The Latest Gaming News
Author: Next Tech Plus

12. Game Development: Evolving Technologies And New Horizons
Author: Rick John

13. Why Svelte Is The Most In-demand Framework For Web Development?
Author: Why Svelte Is The Most In-Demand Framework For Web

14. Maximizing Ebay Sales With Maropost/neto And Pursuit Info Solutions
Author: rachelvander

15. The Importance Of Software Testing: Ensuring Quality In Development
Author: John Mathew

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: