SlideShare a Scribd company logo
London, 20 December, 2012 | | 1
Object Oriented Javascript
What is Object-Oriented Javascript?


1. Object-oriented javascript has the capabilities of the
   object-orient programming like abstractions,
   encapsulations and inheritance.

2. Functions are objects with the capacity to hold
   executable code and pass like any other object.
Naming conventions used in JS


• Case order is : lowercase followed camel case eg:
  displayName

• Meaningful and complete names.

• Proper spacing and new line between each object
  defined. The unit of indentation is four spaces.
<function name>:<space>function<space>()<space>{

}

displayName: function () {

}

More details: http://confluence.lbi.co.uk/display/FP/JS+conventions+guide
How to use?


var LBI = window.LBI || {}; // object created here

LBI.person = { //namespace as person which encapsulates displayName and displayAge methods

            var personName, personAge

            displayName: function (name)        {

                         personName = name; //business logic

                        console.log(“ My name is ” + personName);

            },

            // this is the newline which delimits two objects

            displayAge: function(age) {

                        personAge = age; //business logic

                         console.log(“ My age is ” + personAge );

            }

}
How to use?

Function call can be made like this:

LBI.person.displayName(“xyz”);

LBI.person. displayAge(“22”);
Why it is useful?


1. It helps data and methods that operate on that data to
   encapsulate together as one object.

2. Promotes greater flexibility and maintainability.

3. Easy to develop and has strong emphasis on
   modularity.

4. Modularity promotes caching.

5. Behaviour can be re-used. (like an inheritance in oops)
End

More Related Content

PDF
MongoDB and Web Scrapping with the Gyes Platform
PDF
An Introduction to MongoDB
PPTX
Next Generation of Javascript
PPTX
Introduction to MongoDB
PPTX
Windows ストアーアプリで SQLite を使ってみよう
PDF
Programming services-slides
PPT
Java Script Basics
PDF
Using Augmented Reality for Learning - LavaCon 2010
MongoDB and Web Scrapping with the Gyes Platform
An Introduction to MongoDB
Next Generation of Javascript
Introduction to MongoDB
Windows ストアーアプリで SQLite を使ってみよう
Programming services-slides
Java Script Basics
Using Augmented Reality for Learning - LavaCon 2010

Viewers also liked (11)

DOCX
Blanca roque sosa
PDF
The need for a holistic interpretation of african knowledge systems as a vehi...
PPTX
Apresentação3
PPT
V o grupo 200610 257
PPT
Introduction to Drawing
PPS
PoçAs De Lama
PPTX
Кластер медицинского, экологического приборостроения и биотехнологий
PPSX
MRsquare - функционал системы управления авторскими правами
PDF
cips level 4
PPT
Types Of Centrifugal Fans Used In Power Plant Boilers
ODP
Question 3
Blanca roque sosa
The need for a holistic interpretation of african knowledge systems as a vehi...
Apresentação3
V o grupo 200610 257
Introduction to Drawing
PoçAs De Lama
Кластер медицинского, экологического приборостроения и биотехнологий
MRsquare - функционал системы управления авторскими правами
cips level 4
Types Of Centrifugal Fans Used In Power Plant Boilers
Question 3
Ad

Similar to Object Oriented JS (20)

PPTX
IWT presentation121232112122222225556+556.pptx
PPTX
Object Oriented Programming In JavaScript
PPTX
Javascript Objects and Functions
PPTX
Understanding-Objects-in-Javascript.pptx
PPTX
Javascript Objects and Functions
PDF
A class action
PPTX
Object oriented javascript
PPTX
pert.3&4.pptx
PPTX
JavsScript OOP
PPTX
Object Oriented Javascript part2
PPTX
JavaScript OOPS Implimentation
PDF
OOPS JavaScript Interview Questions PDF By ScholarHat
PDF
JavaScript Objects
PPTX
Object oriented javascript
KEY
Javascript tid-bits
PPTX
An introduction to Object Oriented JavaScript
PPTX
Cordova training : Day 4 - Advanced Javascript
PPT
A Deeper look into Javascript Basics
PPTX
Javascript Objects Deep Dive
PPTX
Awesomeness of JavaScript…almost
IWT presentation121232112122222225556+556.pptx
Object Oriented Programming In JavaScript
Javascript Objects and Functions
Understanding-Objects-in-Javascript.pptx
Javascript Objects and Functions
A class action
Object oriented javascript
pert.3&4.pptx
JavsScript OOP
Object Oriented Javascript part2
JavaScript OOPS Implimentation
OOPS JavaScript Interview Questions PDF By ScholarHat
JavaScript Objects
Object oriented javascript
Javascript tid-bits
An introduction to Object Oriented JavaScript
Cordova training : Day 4 - Advanced Javascript
A Deeper look into Javascript Basics
Javascript Objects Deep Dive
Awesomeness of JavaScript…almost
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
Assigned Numbers - 2025 - Bluetooth® Document
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

Object Oriented JS

  • 1. London, 20 December, 2012 | | 1
  • 3. What is Object-Oriented Javascript? 1. Object-oriented javascript has the capabilities of the object-orient programming like abstractions, encapsulations and inheritance. 2. Functions are objects with the capacity to hold executable code and pass like any other object.
  • 4. Naming conventions used in JS • Case order is : lowercase followed camel case eg: displayName • Meaningful and complete names. • Proper spacing and new line between each object defined. The unit of indentation is four spaces. <function name>:<space>function<space>()<space>{ } displayName: function () { } More details: http://confluence.lbi.co.uk/display/FP/JS+conventions+guide
  • 5. How to use? var LBI = window.LBI || {}; // object created here LBI.person = { //namespace as person which encapsulates displayName and displayAge methods var personName, personAge displayName: function (name) { personName = name; //business logic console.log(“ My name is ” + personName); }, // this is the newline which delimits two objects displayAge: function(age) { personAge = age; //business logic console.log(“ My age is ” + personAge ); } }
  • 6. How to use? Function call can be made like this: LBI.person.displayName(“xyz”); LBI.person. displayAge(“22”);
  • 7. Why it is useful? 1. It helps data and methods that operate on that data to encapsulate together as one object. 2. Promotes greater flexibility and maintainability. 3. Easy to develop and has strong emphasis on modularity. 4. Modularity promotes caching. 5. Behaviour can be re-used. (like an inheritance in oops)
  • 8. End