Enviar pesquisa
Carregar
Objects, Objects Everywhere
•
1 gostou
•
795 visualizações
Mike Pack
Seguir
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 70
Baixar agora
Baixar para ler offline
Recomendados
Object oriented programming in JavaScript
Object oriented programming in JavaScript
Aditya Majety
Week3
Week3
Will Gaybrick
NinjaScript 2010-10-14
NinjaScript 2010-10-14
lrdesign
An introduction to javascript
An introduction to javascript
tonyh1
SOLID Ruby, SOLID Rails
SOLID Ruby, SOLID Rails
Jens-Christian Fischer
jQuery Introduction
jQuery Introduction
Arwid Bancewicz
Elixir + Neo4j
Elixir + Neo4j
Regina Imhoff
Learn css3
Learn css3
Mostafa Bayomi
Recomendados
Object oriented programming in JavaScript
Object oriented programming in JavaScript
Aditya Majety
Week3
Week3
Will Gaybrick
NinjaScript 2010-10-14
NinjaScript 2010-10-14
lrdesign
An introduction to javascript
An introduction to javascript
tonyh1
SOLID Ruby, SOLID Rails
SOLID Ruby, SOLID Rails
Jens-Christian Fischer
jQuery Introduction
jQuery Introduction
Arwid Bancewicz
Elixir + Neo4j
Elixir + Neo4j
Regina Imhoff
Learn css3
Learn css3
Mostafa Bayomi
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
Peter Friese
Json
Json
mussawir20
Introduction to JRuby
Introduction to JRuby
Vagmi Mudumbai
Introduction to XML
Introduction to XML
Return on Intelligence
Ruby objects
Ruby objects
Reuven Lerner
jQuery
jQuery
Jay Poojara
jQuery
jQuery
Dileep Mishra
03 Object Relational Mapping
03 Object Relational Mapping
Ranjan Kumar
NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05
lrdesign
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」
techtalkdwango
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript
Takuya Fujimura
Javascript Objects Deep Dive
Javascript Objects Deep Dive
Manish Jangir
Art of Javascript
Art of Javascript
Tarek Yehia
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
DevClub_lv
Understanding PHP objects
Understanding PHP objects
julien pauli
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
Ignacio Martín
React JS and why it's awesome
React JS and why it's awesome
Andrew Hull
Javascript
Javascript
20261A05H0SRIKAKULAS
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
Núcleo de Electrónica e Informática da Universidade do Algarve
Ruby Classes
Ruby Classes
Daniel Berkompas
Interesting Facts About Javascript
Interesting Facts About Javascript
Manish Jangir
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
Evan Schultz
Mais conteúdo relacionado
Mais procurados
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
Peter Friese
Json
Json
mussawir20
Introduction to JRuby
Introduction to JRuby
Vagmi Mudumbai
Introduction to XML
Introduction to XML
Return on Intelligence
Ruby objects
Ruby objects
Reuven Lerner
jQuery
jQuery
Jay Poojara
jQuery
jQuery
Dileep Mishra
03 Object Relational Mapping
03 Object Relational Mapping
Ranjan Kumar
Mais procurados
(8)
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
Json
Json
Introduction to JRuby
Introduction to JRuby
Introduction to XML
Introduction to XML
Ruby objects
Ruby objects
jQuery
jQuery
jQuery
jQuery
03 Object Relational Mapping
03 Object Relational Mapping
Semelhante a Objects, Objects Everywhere
NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05
lrdesign
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」
techtalkdwango
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript
Takuya Fujimura
Javascript Objects Deep Dive
Javascript Objects Deep Dive
Manish Jangir
Art of Javascript
Art of Javascript
Tarek Yehia
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
DevClub_lv
Understanding PHP objects
Understanding PHP objects
julien pauli
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
Ignacio Martín
React JS and why it's awesome
React JS and why it's awesome
Andrew Hull
Javascript
Javascript
20261A05H0SRIKAKULAS
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
Núcleo de Electrónica e Informática da Universidade do Algarve
Ruby Classes
Ruby Classes
Daniel Berkompas
Interesting Facts About Javascript
Interesting Facts About Javascript
Manish Jangir
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
Evan Schultz
The Ruby Racer: under the hood
The Ruby Racer: under the hood
cowboyd
WDB005.1 - JavaScript for Java Developers (Lecture 1)
WDB005.1 - JavaScript for Java Developers (Lecture 1)
Igor Khotin
Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)
MongoSF
Practical Ruby Projects with MongoDB - MongoSF
Practical Ruby Projects with MongoDB - MongoSF
Alex Sharp
Reasons To Love Ruby
Reasons To Love Ruby
Ben Scheirman
Javascript
Javascript
Sunil Thakur
Semelhante a Objects, Objects Everywhere
(20)
NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript
Javascript Objects Deep Dive
Javascript Objects Deep Dive
Art of Javascript
Art of Javascript
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Things that every JavaScript developer should know by Rachel Appel at FrontCo...
Understanding PHP objects
Understanding PHP objects
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
React JS and why it's awesome
React JS and why it's awesome
Javascript
Javascript
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
Ruby Classes
Ruby Classes
Interesting Facts About Javascript
Interesting Facts About Javascript
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
The Ruby Racer: under the hood
The Ruby Racer: under the hood
WDB005.1 - JavaScript for Java Developers (Lecture 1)
WDB005.1 - JavaScript for Java Developers (Lecture 1)
Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects with MongoDB - MongoSF
Practical Ruby Projects with MongoDB - MongoSF
Reasons To Love Ruby
Reasons To Love Ruby
Javascript
Javascript
Último
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
UiPathCommunity
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
apidays
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Sandro Moreira
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
The Digital Insurer
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
sammart93
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
apidays
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Nanddeep Nachan
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
apidays
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
danishmna97
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Jago de Vreede
Último
(20)
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Objects, Objects Everywhere
1.
Objects, Objects Everywhere
Mike Pack @zombidev
2.
Let’s Talk Objects
Behavior + State
3.
Let’s Talk Objects
Behavior I’m a person, what can I do? Walk Talk Eat Could also be defined as: Move Legs Move Lips Ingest Food
4.
Let’s Talk Objects
Behavior Level of abstraction matters! Behavioral abstraction varies per domain.
5.
Let’s Talk Objects
State I’m a person, who am I currently? Mike Pack Male Brown Therefore, I have attributes: Name Gender Hair Color
6.
Let’s Talk Objects
State States change When I’m 70, my attributes might be: Mike Pack Male Grey
7.
Let’s Talk Objects
Behavior changes too! I just learned to jump, now my behavior is: Walk Talk Eat Jump
8.
Let’s Talk Objects
Behavior + State
9.
HTML <div id=”name”>
Mike </div> Is this an object?
10.
Attribute
HTML Name <div id=”name”> Mike </div> Is this an object?
11.
Attribute
HTML Name <div id=”name”> Mike State </div> Is this an object?
12.
Attribute
HTML Name <div id=”name”> Mike the beef? Where’s State </div> Is this an object?
13.
Attribute
HTML Name <div id=”name”> Mike behavior? Where’s the State </div> Is this an object?
14.
HTML <div id=”name”
onclick=”...”> Mike </div> Is this an object?
15.
Attribute
HTML Name <div id=”name” onclick=”...”> Mike Behavior! </div> State Is this an object?
16.
HTML
HTML is object oriented (albeit, not for purist) HTML does not exhibit other properties of an OO systems: - Inheritance - Polymorphism - etc
17.
HTML
Don’t use onclick=”...” However, without onclick, HTML does not exhibit behavior.
18.
CSS a{ color:
red; } Is this an object?
19.
CSS
Attribute a{ Name color: red; } Is this an object?
20.
CSS
Attribute a{ Name color: red; } State Is this an object?
21.
CSS
Attribute a{ Name color:the beef? Where’s red; } State Is this an object?
22.
CSS a{ color:
red; &:hover { color: blue; } } Is this an object?
23.
Attribute
CSS Name a { color: red; Behavior! &:hover { color: blue; } State } Is this an object?
24.
CSS
a{ Behavior color: red; State &:hover { Change color: blue; } } Behavior changes state.
25.
CSS
CSS is object oriented (not for purist) CSS does not exhibit other properties of an OO systems: - Inheritance - Polymorphism - etc
26.
JavaScript var book =
{ title: “The Art of War” }; Is this an object?
27.
Attribute Name
JavaScript var book = { title: “The Art of War” }; Is this an object?
28.
Attribute Name
JavaScript var book = { title: “The Art of War” State }; Is this an object?
29.
Attribute Name
JavaScript var book = { title: “The Art of Where’s the beef? War” State }; Is this an object?
30.
Attribute Name
JavaScript var book = { title: “The Art of Where’s the beef? It’sWar” implicit! State }; Is this an object?
31.
JavaScript var book =
{ title: “The Art of War”, constructor: function() {...}, hasOwnProperty: function() {...}, ... }; Implicit behavior.
32.
JavaScript JavaScript is object
oriented (of course)
33.
JavaScript It’s not entirely
object oriented JavaScript has primitives, too.
34.
JavaScript If it’s an
object, typeof knows typeof {} === ‘object’ //=> true
35.
JavaScript Integers are not
objects typeof 1 === ‘object’ //=> false
36.
JavaScript undefined
is not an object typeof undefined === ‘object’ //=> false
37.
JavaScript Literals are not
always primitives typeof [] === ‘object’ //=> true
38.
JavaScript typeof
might not return object typeof true === ‘object’ //=> false typeof true === ‘boolean’ //=> true But booleans are objects! new Boolean(1).valueOf() === true //=> true
39.
JavaScript Careful, typeof can
bite typeof null === ‘object’ //=> true new Null() //=> error
40.
Ruby
1 Is this an object?
41.
Ruby
State (accessor) 1 1.real #=> 1 Is this an object?
42.
Ruby
State (accessor) 1 1.real #=> 1 1 + 1 #=> 2 Is this an object?
43.
Ruby
State 1 (accessor) 1.real #=> 1 Behavior 1 + 1 #=> 2 1.+(1) #=> 2 Is this an object?
44.
Ruby Ruby is object
oriented
45.
Ruby Everything is an
object
46.
Ruby Literal arrays are
new objects [].object_id #=> 70318249770140 [].object_id #=> 70318249594160
47.
Ruby Literal strings are
new objects ‘slurpy’.object_id #=> 70318249561400 ‘slurpy’.object_id #=> 70318249500340
48.
Ruby Literal hashes are
new objects {}.object_id #=> 7019206373870 {}.object_id #=> 70192063701240
49.
Ruby Literal regexs are
new objects //.object_id #=> 70192063385520 //.object_id #=> 70192067965040
50.
Ruby Literal ranges are
new objects (1..2).object_id #=> 70192067946460 (1..2).object_id #=> 70192067921120
51.
Ruby Not everything
creates a new object Ruby has singleton objects (objects instantiated once).
52.
Ruby nil is a
singleton nil.object_id #=> 4 nil.object_id #=> 4
53.
Ruby booleans are singletons
false.object_id #=> 0 false.object_id #=> 0 true.object_id #=> 2 true.object_id #=> 2
54.
Ruby Numbers are singletons
1.object_id #=> 3 1.object_id #=> 3
55.
Ruby
um s xn Fi Numbers are singletons 1.object_id #=> 3 1.object_id #=> 3
56.
Ruby Bignums are not
singletons 4611686018427387904.object_id #=> 70192063730740 4611686018427387904.object_id #=> 70192063508580
57.
Ruby Bignums
are not singletons 4611686018427387904.object_id #=> 70192063730740 4611686018427387904.object_id #=> 70192063508580 Why 4611686018427387904?
58.
bytes to store
Ruby integer bytes = 0.size #=> 8
59.
bytes to store
Ruby integer bytes = 0.size #=> 8 8 bits per byte bits = bytes * 8 #=> 64 64 bit machine
60.
bytes to store
Ruby integer bytes = 0.size #=> 8 8 bits per byte bits = bytes * 8 #=> 64 64 bit machine 1 bit for sign + 1 bit for Ruby 2 ** (bits - 2) #=> 4611686018427387904
61.
Ruby 4611686018427387904
Bignum Different objects. 4611686018427387904 - 1 Fixnum Singleton object.
62.
Ruby Why does nil
have object_id of 4? 1 have object_id of 3? true have object_id of 2?
63.
Ruby Because Matz says
so false.object_id #=> 0 0.object_id #=> 1 true.object_id #=> 2 1.object_id #=> 3 nil.object_id #=> 4 2.object_id #=> 5
64.
Ruby
Find by object_id ObjectSpace._id2ref(0) #=> false ObjectSpace._id2ref(1) #=> 0 ObjectSpace._id2ref(2) #=> true ObjectSpace._id2ref(3) #=> 1 ObjectSpace._id2ref(4) #=> nil ObjectSpace._id2ref(5) #=> 2 ObjectSpace._id2ref(6) #=> error ObjectSpace._id2ref(7) #=> 3 ObjectSpace._id2ref(8) #=> error
65.
Ruby Negative object_ids
-1.object_id #=> -1 -2.object_id #=> -3 -3.object_id #=> -5
66.
Objects.useful? # =>
true
67.
Objects.useful? # =>
true Consistent modeling across the stack.
68.
Objects.useful? # =>
true Helpful in representing the real world.
69.
Objects.useful? # =>
true Fun and expressive.
70.
Thanks! @zombidev
Baixar agora