Web dev frameworks vs RIA
How do traditional web development frameworks cope with RIAs?
By RIAs, I am referring to the Flex/Silverlight model (Ajax has a hybrid model in my view, so I’m not discussing that here since I don’t want to muddle up the question).
Coming back to topic, I see that the traditional web development frameworks are inside-out and RIA development as outside-in:
| Traditional web dev frameworks | RIA frameworks |
|---|---|
| Flow: controller ⇒ model ⇒ view (pages) | view ⇒ controller ⇒ model | Everything built into the framework. View is generated via templates. | View is designed separately and it’s what runs first. Backend is a bunch of web services. |
Question: How is this resolved practically?
For example, how do people using Django or Ruby on Rails actually write, say, Flex frontends for their websites?
Do they ditch their templates/rhtml? Do they design the RIA first and then the web service, or the other way around? … etc.
I couldn’t figure out the answer and since there are people out there doing it, I’m hoping the “hoosgot” i.e. lazy web gods will answer.




April 14th, 2008 at 2:00 pm
[...] http://www.swaroopch.com/blog/web-dev-frameworks-vs-ria/ asks Hoosgot, [...]
April 14th, 2008 at 2:33 pm
I’d suggest that if Web standards are used as a common interface, it really doesn’t matter!
Ok, an example. A while ago I needed an easy personal activity tracker. I wanted it in my face a bit on the desktop, which called for something RIA-ish. I wanted the data available in a form that’s reusable, and I want a straightforward view on the web (so my colleagues could see what I was working on).
so I wrote a little desktop app in Java. It’s essentially MVC, with a fairly trivial domain-specific model - I have activity items with title, description and tags.
Server-side I have a Talis Platform store. The desktop app communicates with the server by POSTing a chunk of the domain-specific information expressed as an RDF/XML doc - the stores have this kind of interface out of the box.
For my simple Web view of the data, I have a little bit of PHP which does a SPARQL query on the store (standard SPARQL-over-HTTP endpoint also comes out of the box) and uses XSLT to transform it into the JSON consumed by SIMILE’s Timeline viewer.
Unfortunately I broke the Timeline viewer bit of the app (I think I got out of sync with SIMILE’s scripts). But hopefully you get the idea - small domain-specific components, loosely-coupled using a standard general-purpose protocol (HTTP) and standards general-purpose data model (RDF). For reuse, I can query the store however I like
April 14th, 2008 at 2:33 pm
Since most RIA web apps have a DB, we do the DB design first then just bake the controllers and do the webservice views (sensible frameworks allow you to have webservices by just creating the compatible views)
We just don’t do the front end
April 14th, 2008 at 2:34 pm
oops, forgot a link: http://dannyayers.com/2007/11/02/more-dogfood
April 14th, 2008 at 8:36 pm
In the case of Ruby on Rails, I’ve seen the rhtml files used to simply output XML which is easily consumed by a Flex application.
April 16th, 2008 at 2:35 am
This is what works for me, I’m sure different people have different approaches ..
Sorry for the rather long flow, I started off writing some simple points
Anyways coming to your question ..
Yes, the templates have no use in 99% of the cases, although I have seen some cases where generation may make sense .. FLOB framework for SAP BSP is a good example http://code.google.com/p/flob/ .. you have to note that the kind of RIAs you can create with this approach is very limiting if you want to follow my algorithm above
The interface to the backend data could vary … could be SOAP or Rest based web services that give out XML or JSON .. my favorite one though is AMF .. there are AMF servers available for several backend technologies … LCDS, BlazeDS, AMFPHP, WebORB for (Java, .NET, PHP or ROR), PyAMF, Flourine, Granite Data Services and several others.
April 16th, 2008 at 2:47 am
The title of your post should be ‘Web dev frameworks and RIA’ (you see?)
Instead of generating the HTML view, now your web dev framework (be it Rails or Django or whatever) generates XML or JSON or whatever format that can be consumed easily by your RIA. That’s all.
As a Flex developer, you code to the REST-based APIs. You’re not even aware of what’s enabling that. You don’t even know what the guys on the server side are using. As long as they speak HTTP and XML, you’re good.
Flex/Silverlight is not putting your server-side frameworks out of business. It’s just taking over the responsibility of the UI.
April 16th, 2008 at 9:21 am
My 2 Cents…
I will look at what data I have
What does the user want (slightly different from Mrinal’s approach as I think you cant deliver to the users what you dont have, atleast, without tricking them)
See what Technology you are using at the backed & what your front end can consume (like Manish says)
Then decide on what approach I take - REST, Web Services, AMF, RTMP … etc
BTW, check out the new PyAMF (http://pyamf.org/). It provides AMF support for Python.
April 16th, 2008 at 10:20 pm
@Danny : Thanks for the example, I get what you are saying.
@Tarique : Haha. So that’s the “backend accessed via web services” approach.
@Tim : Thanks, that’s the kind of tips I was looking for.
@Mrinal : Whoa, nice flow list
… Thanks for the insight, I did want to confirm that templates are not used as much in this way of development.
@Manish : The title was meant to indicate only the conflict of interest w.r.t. the V of MVC (templates vs RIAs), not to be taken in general terms
But there is a change in how the backend is designed, right? Previously, most of the work would be done in the controller but now a proper API has to be designed so that the workflow can be invoked by the RIA…
@Raghu : Yes, I agree, but what I was referring to was the contention of how the system is built, specifically w.r.t. the V of MVC and how it affects the backend design
April 17th, 2008 at 12:02 pm
[...] have been going out right implementing solutions on different platforms for AMF. After seeing this post by Swaroop on RIA and Backends, I decided to write this. So, here that the options available for [...]
April 17th, 2008 at 10:21 pm
[...] on Swaroop C H’s Web dev frameworks vs RIA : [On the question of how one develops both client- and server-side with frameworks] I’d [...]
April 17th, 2008 at 10:29 pm
[...] Web dev frameworks vs RIA [...]