I stumbled across this link and thought some of you might find it interesting. It talks about how to make an object inherit from another object. For example, I can make a "Developer" object inherit all the properties and methods of the more generic "Person" object.
So if I went and added a property to the "Person" object (at either design-time or run-time), any objects inheriting from that object would also get it. This may cut down on the amount of code and maintenance time for your project if your project is complex enough to warrant using such a technique.
Adam
There are only 10 types of people in the world: Those who understand binary, and those who don't
Code:
<script>
Person = function(name){
this.name = name || "";
this.birthDate = "unknown";
}
Developer = function(name, skills){
this.base = Person;
this.base(name);
this.skills = skills || [];
}
Developer.prototype = new Person;
var newGuy = new Developer("Bob", ["JavaScript","ASP"]);
alert(newGuy.name)
alert(newGuy.birthDate)
alert(newGuy.skills)
</script>
Adam
There are only 10 types of people in the world: Those who understand binary, and those who don't