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
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
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
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
RTylerCroy
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Results
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Pixlogix Infotech
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Último
(20)
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
🐬 The future of MySQL is Postgres 🐘
🐬 The future of MySQL is Postgres 🐘
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
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