This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Does this work? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//One of the popular concepts in OOP style programming is the concept of loose coupling. | |
//Your objects should have everything they need to carry out their duties from the time you instansiate them (new Object). | |
//Failing that, you should be able to inject any missing dependecies into your classes whenever necessary. | |
//This does not mean you go and create a whole bunch of setters. | |
//Wrong! | |
dog = new Animal(); | |
dog.setColor('blue'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ns= {}; | |
ns.Object = function () { | |
var that = {}; | |
that.toString = function () { | |
return 'I am an Object!!'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*The Great Dependency Injection.*/ | |
//This is psuedo code. Screw the syntax rules! | |
//No dependency injection. | |
class User { | |
private Database db; | |
private String email; |
NewerOlder