Over a million developers have joined DZone.

HTML5: RIA Nexus or Frankenfluff?

· Web Dev Zone

Make the transition to Node.js if you are a Java, PHP, Rails or .NET developer with these resources to help jumpstart your Node.js knowledge plus pick up some development tips.  Brought to you in partnership with IBM.

The idea that the whole web should converge on Flash was loopy for a ton of reasons. I was never drawn to Flash but it didn‘t bother me, until I got solar panels and started paying attention to where energy was going and found that Flash was one of the biggest energy pigs in the history of humanity. Remember that Dickens character from Hard Times whose little factories billow their black soot (that rains down on the town)? That dude‘s mojo was a veritable flea circus next to the amount of soot-stained waste on Flash‘s report card. And it‘s not over. Sure, they have capitulated and we know the future is not their‘s, but their junk is still out there sucking up battery (Ars estimated 30%!) and hence coal.

It‘s impressive how much progress HTML5 is making now. Which is great because on the one hand, HTML is stupid, broken (born that way), and limited, but we are stuck with it, so going back and fixing it at least so that we can shed the horde of parasitic cloakers is the right thing to do. Even just on the question of watching video!! The flash world spawned a sickeningly stupid range of different dumb viewers. I need to play something, maybe move it on its timeline, sorry, I would like some uniformity, you know, like how cars all have gas and break pedals? The AJAX guys were not much better: they turned into Nietzsche‘s Gnat, imagining themselves the center of the known universe. Sorry, I just can‘t get excited about the prospect of pages containing vast clumps of hand-hacked Javascript code. There are AJAX components now, which is good. Here‘s the pathetic part though: it took way too long. JSF has been around since what 2003? and we saw that AJAX was the road forward for it at least 4 or 5 years ago, and JSF2 is still not really all the way out of the chute (Java EE 6 has it but that‘s not really usable yet, and while there are efforts to get it into 5, it‘s not there).

The prospect of combining either JSF or something like it with something like HTML5 is pretty enticing. Because we have all seen the usefulness of RIAs, all the way back to JFC/Swing, the huge barrier (which Flash proved was not that high a hurdle) was having to have people install stuff. HTML5 holds out the prospect of finally coalescing enough consensus to get everyone on board with making it part of their core offering. Not just so we can do the stupid jiggly stuff that Flash seemed to be constantly focused on, but so we can do things like web interfaces that use diagrams, schematics, mixed media (images/video), etc., without having to install a bunch of crap on the client machine.

Having done a bunch of projects that included some diagramming, I started to do a new one recently and was wondering ‘what format should I output these into?‘ And the usual suspects came out and a huge surprise with them: HTML5 supports SVG! I guess I kind of knew that, but what a great thing to realize. Was pretty excited about SVG when it showed up and it‘s one of those technologies that I have never understood why it didn‘t get traction. Looking at it again, kind of made me ill because I am so sick of xml-based ideas, but it‘s actually pretty cool, and, let‘s face the facts: the browser is going to have to put whatever we want to do into a dom tree anyway so..

Went looking for sources and it looks like the HTML5 bubble is just starting to hit now. There are a few books, and there are books about SVG going all the way back almost a decade, but looks like there are a slew in the offing. Meantime, though, I did decide that I would use SVG.

Generating SVG

Will post more about this, but here are a few thoughts. First, I was interested in what it would be like from Java. I had seen Batik before. Looks interesting. I like the idea that you can just paint the way you would and it will generate the SVG, but who uses Java2D anymore? No one. And this project looks pretty dead. I was kind of psyched at the idea of having a DSL for SVG, so I could do my usual fluent builder stuff and buildup images that contain circles, squares, arrows, etc., complete with animations. But then there's the Objective-C side of the equation. There is an offering on that side: libsvg, but looks like it‘s sleepy: last release 2005. I am thinking about starting with a DSL on the O-C side for generating the SVG. Fluent looks different of course in O-C but it is possible.

Rendering SVG

Thankfully, if you are doing things for the mac, the picture here is very good. Because Safari is a first class supporter of HTML5 right now. I got to thinking ‘ok, generate a project and put a web view in it then get that to show some SVG.‘ It was stupid how simple this turned out to be. Furthermore, when you pull the SVG into Xcode, it will even show it to you rendered in there. So this is good because it means I can write a bunch of DSL code in unit tests that execute in a second or two and then see the results pretty quickly, and this will work in a Mac app, or an iPhone/iPad one. BTW, just straight out high octane coding is much better now in Xcode because the new m2 maven plugin in eclipse means every few times you go to run your unit tests, even ones that are tiny and totally isolated, you get the dialog box and it does its resource syncing. This never happens in Xcode. One other benefit at this stage: I found that OmniGraffle Professional can export to SVG, so you have a forge for making your sprites/components that is readily available. Kind of an interesting Agile/Lean angle here on how this all will come together, including how such a tool could support extension.

Ultimately, what I want is a way to componentize a bunch of this and that‘s where the franken fears creep in. Is it going to be doable? or will it turn into a nightmare of trying to glue disparate elements together and hope they don‘t come apart in flight? Only time will tell (or maybe some books that look at real examples). One encouraging sign was I did a search to find out how one would do a drop shadow in SVG and found this gem . Looks like maybe these things can be orchestrated..

Summary: fan so far. This is looking very promising…

Learn why developers are gravitating towards Node and its ability to retain and leverage the skills of JavaScript developers and the ability to deliver projects faster than other languages can.  Brought to you in partnership with IBM.


Published at DZone with permission of Rob Williams, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}