Tuesday, 7 August 2012

OOJS ,WEB SECURITY!

AUDIO bLOG:
http://yourlisten.com/channel/content/16907159/js2

Object Oriented Programming in Javascript is where the Object Oriented Concept is applied to javascript.Just like functions form the first-class in functional programming languages,inheritance and behaviouralism forms the basic in OO Javascript.
-->String ,Arrays,Numbers and Functions in Javascript which are the primitive datatypes are actually to create Objects to each one of them.
-->An object is simply a collection of key value pairs in this language.

Prototype Based Languages:
   This is those kind of languages which does not have the concept of class.The Object oriented property is still carried out by using the objects.
-->Instead of classes Javascript uses functions..
function animal()
{
alert("Person CReated");
.....
.....
............
};
var cat=new animal();
var dog=new animal();

The members are accessed with the help of an object in a way similar to the other object oriented languages,but you don put them into a single class.
dog.shout() will give the sound it produces..

Concept of Constructor:The constructor is called the moment the object is instantiated.This is used to set the properties and variables of the class.

You can assign values to your object by passing the arguments while creating an object.

var dog=new animal("bow bow");

function animal(var sound)
{
 this.sound=sound;
}

dog.shout() will call the function.....

animal.Prototype.shout=function()
{
alert(this.sound());
}
The property of "encapsulation","abstraction","Inheritance and "polymorphism" are followed in JS.
Encapsulation:Dog need not know the content of the method required to "shout".
Abstraction:Methods are scoped to the function to which they belong to.
Inheritance:

This is achieved as follows:
function birds()
{
animal.call(this);
}

//inhertiting from animal
birds.prototype.constructor=birds;
//declaring other functions:
birds.prototype.chirp=function()
{
.....
}
Polymorphism:This can be achieved in a similar way to other object oriented programming languages.

-------------------------------------------------------------------------------------------------------------------
Web Security and Other General Topics:
-->Prefer ordinary javascript core programming to JQuery so that you can
*Increase performance.
*Increase Flexibility.
*avoid you from being DUMB.
In the core javascript programming you will know exactly what you are doing.

The components of a browser are
-->JS Engine
-->HTML Engine
-->CSS engine
-->Networking components.

Safari and chrome uses WebKit  which was developed by KHTML for linux.
Web Security:
1)While you send something to the server it must be cleaned and santized well.You should only pass all what should be stored in the server.Server side script is used to check this.
2)Passwords should be long and must not be dictionary words.Because dictionary attacks can crack it.And even if the hacker accesses the database he must not be able to understand the database,we have to store it in a hashed format.
3)Depends on the software we used to develop that.It must be the most efficient.


- Sourcebits University
Cloud Computing
www.sourcebits.com

No comments:

Post a Comment