MongoDB Monitoring Service (MMS) is a free cloud-based service provided by 10gen for monitoring MongoDB deployments in real time. MMS ensures that you have visibility into the right metrics to manage and optimize applications during development and in production.
Sunday, 11 August 2013
Monday, 15 April 2013
Thursday, 7 February 2013
Understanding OOPs in JavaScript
/firsy thing the most generally you can do
function Weapon(name, damage){
var wName = name; //use var instead of this so it will be private
this.setName = function(text){
//validate the data
if(typeof text === "string"){
wName = text ;
}//end of if
};
this.getName = function(){
return wName;
};
var wDamage = damage;
this.setDamage = function(aDamage){
//validate the data
if(typeof aDamage === "number" && aDamage < 200){
wDamage =aDamage ;
}//end of if
};//end of method
this.getDamage = function(){
return wDamage;
}; //end of method
} //end of contructor
//then you can inherit from Weapon and extend like this
function Gun( range, magazine){
var wName = "Gun" ; //overwrite the name so it will be named gun
//you write de set and get
var wDamage = 150 ; //The same--you can change this of course
var wRange = range ;
//write sets and gets
var wMagazine = magazine;
}//end of contructor
Subscribe to:
Comments (Atom)