What is more viable to use? Javascript libraries or UI Programming tools?
What is more viable to use:-
Javascript Libraries: YUI, jQuery, ExtJs
OR
UI Programming tools: GWT, ExtGWT, SmartGWT
It has become very difficult to choose between them as they are constantly increasing their capabilities to meet newer requirements.
We all know the power of jQuery in UI manipulations. The latest news from Microsoft about jQuery being officially part of .Net developr’s toolkit will definitely make jQuery a preferred choice against other JavaScript libraries [See link: http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx].
But on the other hand, GWT is building a framework which could be used on client as well as on the sever side. This is definitely going to make developers’ life easy as it does not require developer to be an expert in browser quirks, XMLHttpRequest, and JavaScript in order to develop high-performance web applications. It includes SDK (Java API libraries, 开发者_如何学Gocompiler, and development server which allows to write client-side applications in Java and deploy them as JavaScript), Speed Tracer and plug-in for Eclipse. GWT is used by many products like Google Wave and AdWords.
So question is still un-answered, what is more viable to use? Any thoughts?
One tool does not fit all.
Use whatever best fits the needs of the particular project.
jQuery FTW. I am a fan of jquery because it is completely self-contained, you only have the $
in the window, you just add it and use it if you want, it does not add itself to any prototypes nor forces you to work in a certain way.
Also, I personally like better to program in javascript. If I understand it correctly, the selling point of GWT is "you can program everything in Java!". I have programmed in Java, I would preffer to program the server side in javascript too!
I've worked with alot of different Javascript GUI Frameworks such as Bindows, ExtJS, Backbase, Javeline, jQuery UI and all of them can be really great in their own right as long as you understand the kind of webapplication you will be making when you start to rely more on Javascript for UI then plain ol' vanilla HTML.
If you really need a rich user experience with treeviews, collapsable panes, listviews, datagrids, comboboxes. Go with one of the Javascript UI frameworks but be aware that jQuery UI does not compare to bigger brothers such as Bindows and ExtJs.
GWT and Bindows both offer a client side language that can render all the javascript for you and might be a very good pick if Java is your developers language of choice.
If you only want little bits of ajax and some small dom manipulations revert to plain old HTML and spice it up with jQuery. Personally this always wins for me since you're more in control of styling, and all the bits that fly over the line. Javascript UI frameworks tend to be big and hard to style.
GWT is good if you have no competent javascript developers and want stuff fast. Otherwise I would avoid it. Its like playing the piano with boxing gloves
The JavaScript libraries you cite work as a complement to native JavaScript, not instead of it. They are all good, I wouldn't like to make a recommendation except to say you should check out prototype.js/scriptaculous and mootools too.
It depends on whether you are building a website or a web-app. Webapps are easier to build with GWT, websites are easier with a js library.
Use a Javascript Library if your website is content driven, and you don't really have much user interaction. Or if you care about Search Engine Optimization.
Use GWT if your web-app is action-oriented/interactive. Think Gmail/Google Docs. Here the user is interacting heavily with your app.
I think it depends on your background, the type of application you want to do and if you are not alone, the experience of your team. Regarding gwt, there are also mixed approaches:
- You can call js functions via native calls in gwt
- there is a gwt port of jquery (i.e.
$("h1").css("background-color", "red");
is valid java code!) - there are ways to export gwt methods to javascript (this means you can code javascript and access gwt code from there as a library - besides using other js libraries)
Developers can get carried away with GWT creating a mountain of code, forgetting that the target environment is not Java and GWT's complexity brings bugs that need to be debugged in a browser which requires a sound understanding of Javascript. Debugging hundreds of thousands of lines of machine generated code is very stressful when a production issue occurs. Also, it's not browser agnostic. We had a nightmare issue affecting combo boxes in Chrome. No issues in any other browser - but the combo in Chrome would periodically break the entire GUI. We were never able to replicate this in development - because of course with GWT development mode is running under an entirely different scenario to production mode - so for example, subtle Javascript based timing issues werent recreatable in Eclipse in order to troubleshoot.
So although impressive technology - a complex system in GWT will cost a lot more to develop than using other technologies - such as Flex or .NET.
You always can use something like gwt-query (for using jquery in your gwt project) and you can change this library at any time. But if you use something like GXT you will need write your app from scratch.So using gwt libraries (which wrapping js framework or libs) is much better solution.
精彩评论