SlideShare une entreprise Scribd logo
1  sur  13
Beautiful Global Models
- Atul Bhosale
Why GlobalID?
➢ Single identifier to reference different classes
of objects.(App wide URI)
➢ Job scheduling
➢ Dropdown list of options
What is Globalid?
Unique ID across all Model classes
Not same as Primary key
Consists:
• Application name
• Model Class Identifier
How to use it?
2.1.5 :004 > person = Individual.find(1)
=> #<Individual id: 1, name: "Mark", created_at: "2015-05-09 03:51:50", updated_at: "2015-05-09
03:51:50">
2.1.5 :005 > company = Company.find(1)
=> #<Company id: 1, name: "Facebook", created_at: "2015-05-09 03:51:49", updated_at: "2015-05-09
03:51:49">
2.1.5 :006 > person.id == company.id
=> true
2.1.5 :007 > person.to_global_id == company.to_global_id
=> false
2.1.5 :011 > person.to_global_id
=> #<GlobalID:0x0000000688a2b0 @uri=#<URI::GID:0x0000000688a828 URL:gid://globalid-
polymorphic/Individual/1>>
2.1.5 :012 > company.to_global_id
=> #<GlobalID:0x00000006878d80 @uri=#<URI::GID:0x000000068791b8 URL:gid://globalid-
polymorphic/Company/1>>
At Work?
Globalid in ActiveJob
● Whitelist Arguments
o [ NilClass, Fixnum, Float, String, TrueClass,
FalseClass, Bignum ]
● serialize_argument
o argument.to_global_id.to_s
● deserialize_argument
o locate method
Internally
2.1.5 :008 > URI("http://foo/bar/baz").host #=> "foo"
=> "foo"
2.1.5 :009 > URI("http://foo/bar/baz").path #=> "/bar/baz"
=> "/bar/baz"
2.1.5 :010 > URI("http://foo/bar/baz").scheme #=> "http"
=> "http"
Thank you

Contenu connexe

En vedette

world beneath the waves
world beneath the wavesworld beneath the waves
world beneath the wavestaylorlynn7
 
Cmt 3321 intercom presentation 3 week 14
Cmt 3321 intercom presentation 3 week 14Cmt 3321 intercom presentation 3 week 14
Cmt 3321 intercom presentation 3 week 14amitpac7
 
Microsoft word thi bd đh hoa-485
Microsoft word   thi bd đh hoa-485Microsoft word   thi bd đh hoa-485
Microsoft word thi bd đh hoa-485vjt_chjen
 
Bai3 oxitaxitl1
Bai3 oxitaxitl1Bai3 oxitaxitl1
Bai3 oxitaxitl1vjt_chjen
 
2011 04 14 acta reunion director
2011 04 14 acta reunion director2011 04 14 acta reunion director
2011 04 14 acta reunion directorcomiteportos
 
Town hall
Town hallTown hall
Town halliesMola
 
Radzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyam
Radzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyamRadzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyam
Radzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyamIgor Nitsovych
 
Pharaoh's snake at the chemist lab.
Pharaoh's snake  at the chemist lab.Pharaoh's snake  at the chemist lab.
Pharaoh's snake at the chemist lab.iesMola
 
Instructions from God !!
Instructions from God !!Instructions from God !!
Instructions from God !!AAR VEE
 
Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)
Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)
Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)Brethsdenis
 
Operativnoe akywerstvo
Operativnoe akywerstvoOperativnoe akywerstvo
Operativnoe akywerstvoIgor Nitsovych
 

En vedette (16)

world beneath the waves
world beneath the wavesworld beneath the waves
world beneath the waves
 
Cmt 3321 intercom presentation 3 week 14
Cmt 3321 intercom presentation 3 week 14Cmt 3321 intercom presentation 3 week 14
Cmt 3321 intercom presentation 3 week 14
 
Microsoft word thi bd đh hoa-485
Microsoft word   thi bd đh hoa-485Microsoft word   thi bd đh hoa-485
Microsoft word thi bd đh hoa-485
 
Bai3 oxitaxitl1
Bai3 oxitaxitl1Bai3 oxitaxitl1
Bai3 oxitaxitl1
 
2011 04 14 acta reunion director
2011 04 14 acta reunion director2011 04 14 acta reunion director
2011 04 14 acta reunion director
 
Firearms
FirearmsFirearms
Firearms
 
Town hall
Town hallTown hall
Town hall
 
Nakaz №899
Nakaz №899Nakaz №899
Nakaz №899
 
Radzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyam
Radzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyamRadzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyam
Radzinskiy V E__Rukovodstvo_k_prakticheskim_zanyatiyam
 
Pharaoh's snake at the chemist lab.
Pharaoh's snake  at the chemist lab.Pharaoh's snake  at the chemist lab.
Pharaoh's snake at the chemist lab.
 
Instructions from God !!
Instructions from God !!Instructions from God !!
Instructions from God !!
 
MeEvaluation
MeEvaluation MeEvaluation
MeEvaluation
 
Global classroom project 2012 2013
Global classroom project 2012 2013Global classroom project 2012 2013
Global classroom project 2012 2013
 
4. brfdp lesson 1 & 2
4. brfdp lesson 1 & 24. brfdp lesson 1 & 2
4. brfdp lesson 1 & 2
 
Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)
Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)
Image Gallery For Silver Jewellery (Earrings, Pendants, Necklaces, Rings)
 
Operativnoe akywerstvo
Operativnoe akywerstvoOperativnoe akywerstvo
Operativnoe akywerstvo
 

Similaire à Beautiful GlobalID Models

Write once, ship multiple times
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple timesŽeljko Plesac
 
The Wide World Of Google Developer Technologies (STLIC 02-10)
The Wide World Of Google Developer Technologies (STLIC 02-10)The Wide World Of Google Developer Technologies (STLIC 02-10)
The Wide World Of Google Developer Technologies (STLIC 02-10)jasonacooper
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Developmentsonichinmay
 
Face Recognition using C#
Face Recognition using C#Face Recognition using C#
Face Recognition using C#Luigi Oliveto
 
Hitchhiker's Guide to Azure AD - SPSKC
Hitchhiker's Guide to Azure AD - SPSKCHitchhiker's Guide to Azure AD - SPSKC
Hitchhiker's Guide to Azure AD - SPSKCMax Fritz
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 
Mastering Office 365 Development
Mastering Office 365 DevelopmentMastering Office 365 Development
Mastering Office 365 Developmentatwork
 
Mastering Office 365 Development - Toni Pohl, atwork
Mastering Office 365 Development - Toni Pohl, atworkMastering Office 365 Development - Toni Pohl, atwork
Mastering Office 365 Development - Toni Pohl, atworkSPC Adriatics
 
Microsoft Teams community call - February 2020
Microsoft Teams community call - February 2020Microsoft Teams community call - February 2020
Microsoft Teams community call - February 2020Microsoft 365 Developer
 
Resume.. (Alok kumar)
Resume..        (Alok kumar)Resume..        (Alok kumar)
Resume.. (Alok kumar)ALOK KUMAR
 
WSO2Con ASIA 2016: Case Study: Identity in the WSO2 Ecosystem
WSO2Con ASIA 2016: Case Study: Identity in the WSO2 EcosystemWSO2Con ASIA 2016: Case Study: Identity in the WSO2 Ecosystem
WSO2Con ASIA 2016: Case Study: Identity in the WSO2 EcosystemWSO2
 
Table of contents
Table of contentsTable of contents
Table of contentskamal kumar
 
How to remove disable an oa framework personalization (doc id 304670
How to remove  disable an oa framework personalization (doc id 304670How to remove  disable an oa framework personalization (doc id 304670
How to remove disable an oa framework personalization (doc id 304670Ahmad Mkade
 
How to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and AndroidHow to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and AndroidOptimizely
 

Similaire à Beautiful GlobalID Models (20)

Selenium for-ops
Selenium for-opsSelenium for-ops
Selenium for-ops
 
Write once, ship multiple times
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple times
 
The Wide World Of Google Developer Technologies (STLIC 02-10)
The Wide World Of Google Developer Technologies (STLIC 02-10)The Wide World Of Google Developer Technologies (STLIC 02-10)
The Wide World Of Google Developer Technologies (STLIC 02-10)
 
Mrudula CV-2
Mrudula CV-2Mrudula CV-2
Mrudula CV-2
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Face Recognition using C#
Face Recognition using C#Face Recognition using C#
Face Recognition using C#
 
WOdka
WOdkaWOdka
WOdka
 
Hitchhiker's Guide to Azure AD - SPSKC
Hitchhiker's Guide to Azure AD - SPSKCHitchhiker's Guide to Azure AD - SPSKC
Hitchhiker's Guide to Azure AD - SPSKC
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 
Mastering Office 365 Development
Mastering Office 365 DevelopmentMastering Office 365 Development
Mastering Office 365 Development
 
QA_Felipe Fong_Resume
QA_Felipe Fong_ResumeQA_Felipe Fong_Resume
QA_Felipe Fong_Resume
 
Mastering Office 365 Development - Toni Pohl, atwork
Mastering Office 365 Development - Toni Pohl, atworkMastering Office 365 Development - Toni Pohl, atwork
Mastering Office 365 Development - Toni Pohl, atwork
 
Microsoft Teams community call - February 2020
Microsoft Teams community call - February 2020Microsoft Teams community call - February 2020
Microsoft Teams community call - February 2020
 
Resume.. (Alok kumar)
Resume..        (Alok kumar)Resume..        (Alok kumar)
Resume.. (Alok kumar)
 
WSO2Con ASIA 2016: Case Study: Identity in the WSO2 Ecosystem
WSO2Con ASIA 2016: Case Study: Identity in the WSO2 EcosystemWSO2Con ASIA 2016: Case Study: Identity in the WSO2 Ecosystem
WSO2Con ASIA 2016: Case Study: Identity in the WSO2 Ecosystem
 
Table of contents
Table of contentsTable of contents
Table of contents
 
How to remove disable an oa framework personalization (doc id 304670
How to remove  disable an oa framework personalization (doc id 304670How to remove  disable an oa framework personalization (doc id 304670
How to remove disable an oa framework personalization (doc id 304670
 
DEEPAK RAWAT
DEEPAK RAWATDEEPAK RAWAT
DEEPAK RAWAT
 
How to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and AndroidHow to feature flag and run experiments in iOS and Android
How to feature flag and run experiments in iOS and Android
 

Beautiful GlobalID Models

  • 2.
  • 3.
  • 4.
  • 5. Why GlobalID? ➢ Single identifier to reference different classes of objects.(App wide URI) ➢ Job scheduling ➢ Dropdown list of options
  • 6. What is Globalid? Unique ID across all Model classes Not same as Primary key Consists: • Application name • Model Class Identifier
  • 8. 2.1.5 :004 > person = Individual.find(1) => #<Individual id: 1, name: "Mark", created_at: "2015-05-09 03:51:50", updated_at: "2015-05-09 03:51:50"> 2.1.5 :005 > company = Company.find(1) => #<Company id: 1, name: "Facebook", created_at: "2015-05-09 03:51:49", updated_at: "2015-05-09 03:51:49"> 2.1.5 :006 > person.id == company.id => true 2.1.5 :007 > person.to_global_id == company.to_global_id => false 2.1.5 :011 > person.to_global_id => #<GlobalID:0x0000000688a2b0 @uri=#<URI::GID:0x0000000688a828 URL:gid://globalid- polymorphic/Individual/1>> 2.1.5 :012 > company.to_global_id => #<GlobalID:0x00000006878d80 @uri=#<URI::GID:0x000000068791b8 URL:gid://globalid- polymorphic/Company/1>>
  • 10. Globalid in ActiveJob ● Whitelist Arguments o [ NilClass, Fixnum, Float, String, TrueClass, FalseClass, Bignum ] ● serialize_argument o argument.to_global_id.to_s ● deserialize_argument o locate method
  • 11.
  • 12. Internally 2.1.5 :008 > URI("http://foo/bar/baz").host #=> "foo" => "foo" 2.1.5 :009 > URI("http://foo/bar/baz").path #=> "/bar/baz" => "/bar/baz" 2.1.5 :010 > URI("http://foo/bar/baz").scheme #=> "http" => "http"