Your SlideShare is downloading. ×
Datamapper
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Datamapper

940
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
940
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. DataMapper == ActiveRecord 3.0?
    • Miksi? (vrt. ActiveRecord)
      • Enemmän Rubyä, vähemmän SQL:ää
      • AR: Migraatio/malli -ongelmat
        • DataMapper: malli ohjaa tietokantaa eikä toisinpäin
      • Intuitiivinen olioidentiteetti
        • entity.children.all? {|c| c.parent == entity} # => true
      • Fiksumpi SQL-generointi: Lazy loading + Smart Associations
        • tekstikentät luetaan oletuksena vain tarvittaessa, assosioitujen tietojen lukeminen
  • 2. Esimerkki
    • class Employee include DataMapper::Resource property :id, Integer, :serial => true property :name, String # i can has ruby semantics! property :role, String, :accessor => :private property :description, Text, :lazy => false property :deleted_at, ParanoidDateTime belongs_to :company has n, :projects end
  • 3. Muuta
    • Taulujen luominen
      • DataMapper#auto_migrate! # checkout & deploy?
    • Suorituskyky
    • ks. http://work.rowanhick.com/2008/02/19/rails-vs-merb-activerecorddatamapper/ Rails: 42.16 req/s (baseline) # 770 testiriviä Merb + ActiveRecord: 57.80 req/s (1.37x) Merb + Datamapper: 72.98 req/s (1.73x) Rails: 22.82 req/s (baseline) # 11050 testiriviä Merb + ActiveRecord: 29.85 req/s (1.30x) Merb + Datamapper: 33.91 req/s (1.48x)
  • 4. Mutta ihan oikeasti...
    • => Jarkon vuoro :*)