wulin kungfu final

Post on 28-Jan-2015

190 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Wulin Kungfu Fight for Ruby Enterprise problems

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

Problems

! Extjs (everything is JavaScript)

!   Code duplication !   Controllers setup for the JSON

!   JavaScript setup of the grid and screens

!   Heavy UI - Instability

We hope …

!   Lighter

!   Easier

!   DSL

!   Faster productivity

Birth of WulinMaster

WulinMaster

!   A Ruby on Rails based framework

!   For resolving enterprise problems

!   Developer friendly

!   Extensible

!   Application Interface

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.

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

Create Your Guild

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’ �

Build the menu

# app/controllers/homepage_controller.rb �

Wulin Grid

!   Fundamental component

!   Remote data

!   Auto cell types

!   Association columns

Wulin Screen

!   Fundamental container

!   One/more grids/panels

!   Specific configurations for grids in it

Model View

Controller

Browser

Rails MVC

Model

Screen

Controller

Browser

Wulin MVC

both change

Auto generated

grid grid

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�

# app/grids/blogger_grid.rb �

# app/screens/blogger_screen.rb �

Your first house!

Furnish it

!   Grid Action

!   Grid Behavior

!   Grid Relation

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.

Grid Behavior

!   Passive Triggered by grid event

!   Implemented by JavaScript

!   Default behaviors

# app/assets/javascripts/actions/show_info.js�

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

Grid Relation

!   One screen, multiple grids

!   Interaction between grids

!   Default relations

# app/screens/bloggers_posts_screen.rb �

Level up!

Crafting your own weapon

!   Rails Engine

!   Write your own components

!   Define your own actions / behaviors

!   Equip it

Open source

! http://github.com/ekohe/wulin_demo �

! http://github/com/ekohe/wulin_master �

!   http://wulin_demo.ekohe.com�

Jimmy Huang (jimmy@ekohe.com) 黄腾

@pake007

top related