RESTful (Prototyping) Framework
That was a long long time since I wrote something about Flex, But looks like I found some time for both Game and RIA industries.
I want to share some of my RESTful client library ideas and concepts. I’m trying to build something very laconic, light and still powerful to connect to various REST Services.
Please note, current version is PREVIEW, which means far before ALPHA, I’m just trying around some stuff, can be not pretty.
So, here is how I want this stuff to work:
Let’s say we have imaginary Social Network, with following REST Operations:
- http://api.socnet.com/users/search
- http://api.socnet.com/users/show
- http://api.socnet.com/users/friends/list
- http://api.socnet.com/photos/new_ones
I can build (IMO) pretty Service structure right in MXML:
<fx:Declarations> <kii:Service id="main" endPoint="http://api.socnet.com/"> <kii:Service id="users" endPoint="users"> <kii:Service id="friends" endPoint="friends"/> </kii:Service> <kii:Service id="photos" endPoint="photos"/> </kii:Service> </fx:Declarations>
And then access it simly like this:
users.post('show', {some_param: someParam}); fiends.get('list'); photos.get('new_ones', {limit: 25});
Later on I can extend Service classes to include concrete methods like Users.list() and Users.update(); but framework is ready to use and might be much more useful than HTTPService right out of box. Again I’m not sure whether I will be using this framework for prototypes only or for release projects too.
You can get source code and binaries from Google Code
Posted in: AIR, ActionScript, Flash, Flash Platform, Flex, MXML and REST(ful)

