views:

70

answers:

2

I like Silverlight because of the following, in brief:
-declarative GUI language (XAML)
-data and command binding
-GUI designer
-MVVM pattern
-strong typed language.

But Silverlight isn't available everywhere. I'd like to investigate alternatives which doesn't involve any browser plugin. Basically javascript frameworks with a compiler that compiles from a strong typed language (mostly JAVA) to javascript.

Basically I want to develop "Silverlight apps" without Silverlight.

I know that SL grade graphics and animation is impossible because of the limitations of HTML. But that is not an issue. The point is not about features but development style. One exception is that the resulting UI should be customizable. Not just colors and fonts, but layout and structure. So not all the applications look the same.

I have found two frameworks so far(I've sorted out at least 5):
-ZK - seams the best so far
-GWT with UIBinder (new in GWT 2.0), but UIBinder isn't supported in any designer.

So...

-Is this a valid question at all? (I hope so :))
-If it is, which is the best in your opinion? Not necessarily from the two above.

A: 

I don't think there are really any that completely match Silverlight, but I'd say besides highly graphical apps, you can do almost everything with just JS. You may have to mix and match libraries or develop your own, but here's a few from the top of my head that can do some of what you ask about:

  • You can use <canvas> tag or SVG to do graphics, for this you can use f.ex. Raphael and dojox.gfx
  • For UI widgets, there are various libraries like Dojo, Ext JS, SproutCore
  • Ext JS has a UI designer tool
  • Dojo's dijit templates and Ext JS's components have sort-of data binding'ish features (maybe others too but these I'm familiar with)
  • Most libraries (incl. the ones I've mentioned) should have capabilities for animating UI elements smoothly
  • As for static typing stuff, GWT is probably your best bet since you actually use Java to write it. Besides that there isn't much you can do - personally I'd recommend (ab)using the JS language's features for what they were meant for, and not attempting to emulate something it is not.

It may take some getting used to since JavaScript is not Java or C#, but I would say that you can develop RIA's very well with it. There are some things you may need to work around a bit due to limitations, but most things are doable and work well in modern browsers.

Jani Hartikainen
I afraid you're missing my point. I really want to develop silverlight sytle becouse i think it's the best (along with WPF) for ui development.
naeron84
No, I'm not missing your point. I told you the reality: If you want Silverlight, you need to use Silverlight. If you want to use JavaScript, then my answer here tells you the best tools you can use in JS. You can't have the exact same development experience in a completely different language.
Jani Hartikainen
I'm not constrained by reality. :) I expected an "out of the box" answer for my question. If I have to - and worth it - I create my own framework from pieces. I was looking for those pieces. You are saying it's impossible. Finally I decided a week ago or so to use GWT with UIBinder.
naeron84
A: 

If you want something with better deployment stats, look up Adobe Flex. It's more mature than Silverlight but it's currently the leading RIA SDK and doesn't suffer from the low availability problem of SL. If you're seriously considering switching to AJAX/JavaScript/DHTML hacks--don't. This is like taking a step backwards in terms of technology. You're missing many of the advantages in addition to those you've mentioned of using a virtual machine based approach to rich client development:

O&M costs: Most "engineers" don't give a rats A about this because they are development-centric, but the fact is that O&M is by far the leading cost of running IT systems. With a VM approach like Flex (or Silverlight, or JavaFX) you don't have to worry about updating libraries, testing, applying fixes, and so on when a new browser comes out.

Performance: Flash (Flex) is JIT compiled, (wouldn't be surprised if SL is too), and Java is as well. Interpreted JavaScript dependent libraries such as GWT simply cannot hold a candle to the performance you get out of a compiled VM client--it's not even a close comparison. (Just look pay attention to how slow Gmail typically loads--a very simple AJAX-enabled script.)

Consistency/Reliability: Everyone knows that when you write anything using JavaScript or HTML, it has to be tested in every browser (including some older versions if you really want to be safe). No such problem when you're targeting a VM platform. With AJAX: worry whenever a new browser or version of a browser is released. If there's problems, it'll create work for you.

Job Market: While AJAX/JavaScript/DHTML is still very common (depending on the area you look), there's dozens of "frameworks" out there. An expert in DOJO is not an expert in GWT. An expert in GWT is not an expert in jQuery. Etc. If an employer is looking for a Flex developer (which is becoming quite common in job listings I've seen), they actually mean Flex and not some random framework built using Flex. The point is: VM-based job markets like Flex or Silverlight are not fragmented like the JavaScript/DHTML realm is.

Richer components and a better user experience: This is one of Adobe's big selling points, but it's true. While some of the stuff that has been done purely with browser scripting (JavaScript) is impressive, Flex or Silverlight components are better. It's also easy to create your own custom components when you don't need to write (and maintain!) cross-browser JavaScript magic.

Flex specific, but worthy of mention--AMF: This is the Flex Data Services binary protocol which can be used to talk to servers. Benchmarks (ask Google) have demonstrated this protocol to be much faster and more bandwidth efficient than protocols used by AJAX frameworks.

It's a sensitive topic for many. Most AJAX/DHTML/JavaScript 'engineers' or whatever they call themselves will howl and throw feces at the mere suggestion that this 1990's technology they have spent years becoming an expert in is outdated and flawed (quite frankly they have a lot to lose). But based on pure technical merit, even HTML5 is a counter productive waste of time compared to any mature VM based solution. I'm sure some will show up shortly to defend their cult of denial.

Imagine what would have been possible had Google, instead of throwing who knows how much money at JS and Google Chrome (not that Chrome is a bad thing), had instead created a free open source plugin competitor to Flash? Gmail wouldn't be doing email: it would probably be sending webcam-recorded video mail or live feeds in addition to that, and who knows what else would have been possible.

It would be nice if the browser finally evolved into an application delivery mechanism for standardized VM-platforms such as Flash, Silverlight, JavaFX, or whatever OSS devs can come up with. Time to move out of the 20th century yet?

Crusader
Are you serious? It's off topic and smells like spam.
naeron84
JavaScript and AJAX flaws are off topic? You're asking a question about *exactly* this topic, you've said yourself that you're not aware of what's out there. You asked for Silverlight-like features without the shortcomings of SL. I took the time to write up a long response to address your concerns and help you determine what type of issues to expect in RIA dev. I don't understand why you feel this is off topic.Jani was trying to tell you above that there *are* no JavaScript alternatives, the only information to add was VM-based alternatives (like Flex), so I tried to help you out there...
Crusader
I think the problem is that you've already made your decision. Don't even think about creating your own framework from scratch (especially another fragile JavaScript FW), I've already mentioned some of the nightmares you would have to deal with just to keep such a beast working year by year. Don't put yourself through that.The hardware world is moving on from the 90's to virtualization and cloud computing, the software world needs to wake up to this reality and stop trying to prolong the life of fragile legacy technologies.
Crusader