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

Wulin Kungfu - Fight for Ruby Enterprise problems

Jimmy Huang
November 18, 2012

Wulin Kungfu - Fight for Ruby Enterprise problems

My topic on RubyConfChina2012, introduces wulin_master gem which is used for building enterprise application with ruby.

Jimmy Huang

November 18, 2012
Tweet

More Decks by Jimmy Huang

Other Decks in Programming

Transcript

  1. Wulin Kungfu Fight for Ruby Enterprise problems

  2. Background !   FIFA World Cup 2010 in South Africa

    !   BSS software managing the Broadcasting of the event !   TV and Radio orders !   Broadcasting instructions !   Temporal booking !   Spatial booking !   Finance
  3. None
  4. Problems ! Extjs (everything is JavaScript) !   Code duplication

    !   Controllers setup for the JSON !   JavaScript setup of the grid and screens !   Heavy UI - Instability
  5. We hope … !   Lighter !   Easier !

      DSL !   Faster productivity
  6. Birth of WulinMaster

  7. WulinMaster !   A Ruby on Rails based framework !

      For resolving enterprise problems !   Developer friendly !   Extensible
  8. !   Application Interface

  9. Tools and technologies !   Based on: !   Ruby

    on Rails ( >= 3.1 ) ! SlickGrid ( https://github.com/mleibman/SlickGrid ) ! jQuery plugins (jQuery UI, BBQ …) !   The Wulin plugins are Rails Engines. !   Use JSON as communication format.
  10. Architecture Your Application Ruby on Rails WulinMaster WulinGrid WulinScreen SlickGrid

    WulinPanel jQuery Plugins WulinScreenController WulinOAuth WulinAudit WulinPermit WulinExcel Other Wulin Plugins GridAction GridBehavior GridRelation GridColumn WulinHomeController GridStates
  11. Create Your Guild

  12. Wulin generator rails g wulin_master:install create app/controllers/homepage_controller.rb (menu configuration) create

    config/initializers/wulin_master.rb route root :to => 'homepage#index’
  13. Build the menu # app/controllers/homepage_controller.rb

  14. None
  15. Wulin Grid !   Fundamental component !   Remote data

    !   Auto cell types !   Association columns
  16. Wulin Screen !   Fundamental container !   One/more grids/panels

    !   Specific configurations for grids in it
  17. Model View Controller Browser Rails MVC Model Screen Controller Browser

    Wulin MVC both change Auto generated grid grid
  18. Build a screen and a grid rails g wulin_master:screen_and_grid blogger

    name:string age:integer country:reference create db/migrate/20121115075159_create_bloggers.rb create app/controllers/bloggers_controller.rb create app/screens/blogger_screen.rb create app/grids/blogger_grid.rb create app/models/blogger.rb create app/views/bloggers route resources :bloggers
  19. # app/grids/blogger_grid.rb # app/screens/blogger_screen.rb

  20. None
  21. Your first house!

  22. Furnish it !   Grid Action !   Grid Behavior

    !   Grid Relation
  23. Grid Action !   A toolbar button !   Active

    – respond to a user event !   Implemented in JavaScript !   Default actions are: Add, Edit, Delete !   Plugins might provide default actions such as Export Excel, Audit, etc.
  24. Grid Behavior !   Passive Triggered by grid event !

      Implemented by JavaScript !   Default behaviors
  25. None
  26. # app/assets/javascripts/actions/show_info.js

  27. # app/assets/javascripts/behaviors/say_hello.js

  28. Grid Relation !   One screen, multiple grids !  

    Interaction between grids !   Default relations
  29. # app/screens/bloggers_posts_screen.rb

  30. None
  31. Level up!

  32. Crafting your own weapon !   Rails Engine !  

    Write your own components !   Define your own actions / behaviors !   Equip it
  33. Open source ! http://github.com/ekohe/wulin_demo ! http://github/com/ekohe/wulin_master !   http://wulin_demo.ekohe.com

  34. Jimmy Huang (jimmy@ekohe.com) 黄腾 @pake007