Upgrade to Pro — share decks privately, control downloads, hide ads and more …

October 2011 - Building Social Enterprise with ...

dallasruby
October 06, 2011

October 2011 - Building Social Enterprise with Ruby and Salesforce

Raymond Gao walks through the various architectures available for building enterprise applications, with an emphasis on using Ruby and Salesforce.

Demo code available at https://github.com/raygao

Ray can also be found at:
* http://raysblog.are4.us
* http://twitter.com/raygao

dallasruby

October 06, 2011
Tweet

More Decks by dallasruby

Other Decks in Programming

Transcript

  1. Market Cap of Top Cloud Computing Companies Name (Ticker) Market

    Cap (Billions ) Stock Price ($) Key Product(s) Google (GOOG) $160 B $495.52 G App Engine Amazon (AMZN) $96.23 B $211.98 AWS Vmware (VMW) $33.31 B $78.89 Server Virtualization Salesforce (CRM) $15.16 B $111.91 Force Platform NetApp (NTAP) $12.39 B $33.64 Storage RackSpace (RAX) $31.49 B $31.49 Cloud Services
  2. 2010 2011 Web Usage 4 hours per month Rest of

    the Web Sources: Ben Elowitz, Wetpaint / comScore Social Revolution
  3. Facebook Members (Growth of Social Networking) !   More than

    500 million active users !   over 900 million objects (pages, groups, events and community pages) !   About 70% of Facebook users are outside the United States 9 Novembre, 2010 2010 IUT Cloud Computing Seminar 7
  4. Your Data Model Your business logic Data Layer Application Logic

    User Interface Screens exposed to the end users
  5. How are your opinions? !   What do you like

    most? !   What do you like least? !   What kinds of difficulties have you had? !   What do you think the real world is like?
  6. Classic Approach Meets Classic Problems !   Too Simplistic !

      Linear model !   Inflexible !   Static Input / Output !   Either Quality, Time, or Cost Read my blog - http://www.are4.us/?p=815
  7. Data Store is everywhere !   Browsers (Chrome, Firefox, IE,

    Opera) !   Mobile devices (Iphone, Android, Blackberry, Windows CE, Symbian) !   Adobe Flash Applications !   Desktop Applications !   Game Consoles, !   Everywhere !!!
  8. Some Causes !   SW developers are not natural born

    DBAs !   Developing a good data scheme is pretty tough !   Convince your partner to use your DB scheme is tougher! !   DB administration could be a full time job !   Backup !   Security !   Profiles ! Etc
  9. Benefits of Ruby on SF !   There are lots

    of incentive to use Ruby !   Tools for building web-apps (ERB, HAML, Markdowns) !   Methodology (BDD – Cucumbe, Rspec, Shoulda) !   Testing (Webrat, Capybara, Unit Testing) !   Ease of Deployment & code version & collaboration (Git) !   Extensive Code libraries – Github & RubyGems !   Many more
  10. History of Ruby on Salesforce !   Version 0 –

    API era !   Version 1 + 2 (REST + SOAP) – Force.com Era !   Version 3 – (Pure REST) Database.com era
  11. The Datbase.Com GEM !   Covers both Sobject & Chatter

    API !   Full CRUD on DDL side !   Support: !   User-name password !   Security token ! Oauth Flow
  12. Basic Steps !   Use the GEMs !   Create

    a client with Consumer key + secret !   Authenticate (3 options) !   Materialize an Sobject + set Namespace (module name) !   CRUD operation on the object !   Form-building attributes
  13. Use the Gem ! Add GEMs to Gemfile !  

    gem 'databasedotcom' !   gem 'databasedotcom-rails’ (optional) !   Run bundle install
  14. Initialize the client !   # configure client id/secret explicitly

    # client = Databasedotcom::Client.new :client_id => "xxx", :client_secret => "yyy" !   # configure client id/secret from a YAML file # client = Databasedotcom::Client.new "databasedotcom.yml" !   # configure client id/secret from the environment # client = Databasedotcom::Client.new
  15. Authenticate !   # authenticate with a username and password

    client.authenticate(:username => "[email protected]", :password => "arkham") !   # authenticate with a callback hash from Omniauth client.authenticate(hash_from_omniauth) !   # authenticate with an externally-acquired OAuth2 access token client.authenticate(:token => "whoa-that-is-long")
  16. ! client.materialize("Contact") ! Contact.attributes #=> ["Name", "Company", "Phone"] ! ron

    = Contact.find("rons_id") !   puts ron["Company"] #=> "The Olde Company, Inc." ! ron["Company"] = "Some New Gig, LLC" ! ron.reload["Company"] #=> "The Olde Company, Inc." ! ron["Company"] = "Some New Gig, LLC" ! ron.save ! ron.reload["Company"] #=> "Some New Gig, LLC" Materialize a SObject Class CRUD operations
  17. Get More Info !   Presentation - http://dreamforce-demo.heroku.com/ slides#slide17 !

      API doc - http://rubydoc.info/gems/databasedotcom/ frames !   Join the Google Group ActiveSalesforce http://groups.google.com/group/activesalesforce