Ruby on Rails in UbiSunrise

2,939 views

Published on

My Talk in UbiSunrise 4/22

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,939
On SlideShare
0
From Embeds
0
Number of Embeds
47
Actions
Shares
0
Downloads
139
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Ruby on Rails in UbiSunrise

  1. 1. Ruby on Rails BY thegiive ( License by CC 2.0 )
  2. 2. About me • ID : thegiive • SocialPicks.com • Ruby on Rails • Blog : http://lightyror.thegiive.net/ • Email : thegiive at gmail . com
  3. 3. Outline • Ruby on Rails • Ruby on Rails • Rails • Active Record • • Active Record
  4. 4. Ruby on Rails A 95.00 71.25 47.50 C B 23.75 0 6 7 8 9 10 11 12 1 2 3 4
  5. 5. A 95.00 71.25 47.50 23.75 0 6 7 8 9 10 11 12 1 2 3 4
  6. 6. Before Rails day 10% • PHP • • 90%
  7. 7. After Rails day Survey Bloging • 2 PHP 10% Project 20% 40% • • 30%
  8. 8. Phone time project • “ “ • 20 code • 3
  9. 9. B 95.00 71.25 47.50 23.75 0 6 7 8 9 10 11 12 1 2 3 4
  10. 10. • • • • •
  11. 11. Coding RD Rails PHP 0 25 50 75 100
  12. 12. C 95.00 71.25 47.50 23.75 0 6 7 8 9 10 11 12 1 2 3 4
  13. 13. PS2 10
  14. 14. After PS2 Day Blog Survey PS2 • 20% • 30% Project • 30% 10% 10%
  15. 15. Ruby on Rails • MVC • Ruby • DHH Basecamp Project
  16. 16. • David Heinemeier Hansson • DHH • 26 DHH Blog
  17. 17. How Hot is Rails • Rails 2006 400 150 24 • 2005 Ruby on Rails 1500% 2006 700% • Ruby 26 13
  18. 18. Rails Clone
  19. 19.
  20. 20. JAVA (Spring/Hibernate) Rails 4 (20 / )4 (5 /) 3293 1164 1161 113 Class/method 62/549 55/126 Justin Gehtland Blog
  21. 21. • RD • • • Web Site • Performance
  22. 22. ( • • • PS2
  23. 23. • Justin Gehtland JAVA : Rails = 3.5 : 1 • Java : Rails = 25 : 1 • Proc.net PHP : Rails = 10 : 1 • JavaEye JAVA : Rails = 10 : 1 • PHP : Rails = 8 : 1 http://lightyror.blogspot.com/2006/10/rails.html
  24. 24. Rails
  25. 25. • ORM • Convention over Configuration • Don’t Repeat Yourself • Domain Specific Language
  26. 26. ORM • Object Relational Mapping • • Propel Hibernate Active Record ...
  27. 27. Convention over Configuration <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping • PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.d <hibernate-mapping> <class name="test.hibernate.Order" table="orders"> <id name="id" type="string" unsaved-value="null" > <column name="id" sql-type="integer" not-null="true"/> <generator class="native"/> • </id> <key column="order_id" /> <one-to-many class="test.hibernate.OrderItem" /> </set> </class> </hibernate-mapping>
  28. 28. DRY • Don’t Repeat Yourself • View Helper Partial DRY • Controller Module Lib DRY
  29. 29. Domain Specific Language • Ruby DSL • Rails DB-Driven Web App DSL • has_one , has_many , HABTM • symbol ( :abc )
  30. 30. Migration create_table :stores do |t| t.column :name , :string t.column :info , :text t.column :open_time , :string t.column :user_id , :integer t.column :created_at , :datetime t.column :updated_at , :datetime end
  31. 31. Active Record • Rails • ORM • Convention over Configuration • 1:1 1:m n:m • MySQL SQL Server Oracle SQLite
  32. 32. ORM Example a = People.new People id int a = People.find(1) name varchar phone varchar a.name = ‘David’ address text a.destroy sex enum a.save
  33. 33. Relation Table Example Article People id int id int name varchar person_id int phone varchar title varchar address text content text sex enum created_at datatime
  34. 34. Relation ORM a = People.find(1) a.articles a.articles.find(:first) a.articles << Article.new(...) Person a
  35. 35. • • • Legacy • Template
  36. 36.

×