Date post: | 03-Jul-2015 |
Category: |
Technology |
Upload: | elliando-dias |
View: | 1,373 times |
Download: | 0 times |
RestfulX“The RESTful Way to develop
Adobe Flex and AIR applications”or
“Flex on Rails”
Peter [email protected] www.ruboss.com
twitter: @peterarmstrong
why?
Flex + Rails, before RestfulX
Flex + Rails + AIR, before RestfulX
What arewe doing80%
of the time?
RESTful CRUD
Flex + Rails, with RestfulX
Flex + Rails + AIR, with RestfulX
RestfulXFeatures!
http://restfulx.github.com/http://groups.google.com/group/restfulx-framework/
Ruboss FrameworkRuboss Company Project (Dima lead)Dima was Ruboss CTO© RubossGPL v3 & Commercial License
RestfulX Framework(“RESTful X” / “REST Flex”)Community Project© Dima Berastauand ContributorsMIT License
2008
2009
shocking news: you can’t sell verymany framework licenses in 2008!
RestfulX History
RestfulX, Ruboss and Dima Today
= Peter Armstrong +Scott Patten
Dima is now doing freelance RestfulX development and is building a time tracking product using RestfulX.
Peter and Dima are writing a bookFlex Development with RestfulX
and will be publishing it on Sopobo.
Ruboss is doing RestfulX consulting
and development and is working on
Sopobo.com, a site to self-publish PDF
books. We’re building it in Rails, Flex and RestfulX. Scott’s S3 book is on it today.
DEMO
0. If you have run this before, delete a pomodo.db database from home directory.
1. Create the Rails app, install RestfulX and create the Flex project:$ sudo gem install restfulx$ rails -d mysql pomodo$ cd pomodo
2. Edit config/environment.rb and add: config.gem "restfulx"
3. Run rx_config with the distributed option:$ ./script/generate rx_config --distributed
4. Create your data model:$ emacs db/model.yml
5. Generate the app, recreate the database and run your server:$ ./script/generate rx_yaml_scaffold$ rake db:refresh$ ./script/server
6. Import the project into Flex Builder and compile the Flex code.
7. Go to http://localhost:3000.
8. Convert the app to AIR:a) Stop your server.b) Delete the project in Flex Builder. (Don't delete contents.)c) ./script/generate rx_config -a --distributedd) Import the pomodo project into Flex Builder again.e) [WORKAROUND] Fix the routes, which got hosed by rx_config -a --distributed: map.resources :locations map.resources :notes map.resources :tasks map.resources :projects map.resources :users
9. Test online/offline:a) Start your server.b) Rebuild and run the AIR app. Note that it's empty.c) Start your server. Note that online detection works. Do a pull.d) Create tasks, projects, etc.e) Do a push.
project: - name: string - notes: text - start_date: date - end_date: date - completed: boolean - belongs_to: [user] - has_many: [tasks]
location: - name: string - notes: text - belongs_to: [user] - has_many: [tasks]
task: - name: string - notes: text - start_time: datetime - end_time: datetime - completed: boolean - next_action: boolean - belongs_to: [project, location, user]
note: - content: text - belongs_to: [user]
user: - login: string - first_name: string - last_name: string - email: string - has_many: [tasks, projects, locations] - has_one: [note]
db/model.yml:
It’sjustthat
easy.