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

rom 4.0 is coming

rom 4.0 is coming

Avatar for Piotr Solnica

Piotr Solnica

July 09, 2017
Tweet

More Decks by Piotr Solnica

Other Decks in Programming

Transcript

  1. EASE OF USE > Little code to write to get

    started > A lot of functionality OOTB > No boilerplate 21
  2. > Dynamic query interface > Explicit representation of data structures

    > Mapping to struct objects decoupled from the database > No concept of lazy-loadable associations 23
  3. module Entities class User < ROM::Struct def first_name name.split(' ').first

    end def last_name name.split(' ').last end end end 42
  4. module Entities class User < ROM::Struct def first_name name.split(' ').first

    end def last_name name.split(' ').last end end end 43
  5. AT ANY POINT IN TIME YOU CAN DEFINE STRUCTS WITH

    EXPLICIT ATTRIBUTES AND ASK ROM-RB TO LOAD THEM 50
  6. require "entities/address" module Entities class UserProfile < ROM::Struct attribute :email,

    Types::Strict::String attribute :name, Types::Strict::String attribute :age, Types::Strict::Integer attribute :address, Address end end 51