Created
August 7, 2013 01:22
-
-
Save ScottG489/6170429 to your computer and use it in GitHub Desktop.
This file contains 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
// Kinda pseudo code/java | |
class Person { | |
Person(int personID) { | |
database = Database() | |
name = database.getName(personID) | |
address = database.getAddr(personID) | |
phone = database.getPhone(personID) | |
} | |
} | |
// Lazy loading would look like... | |
class Person { | |
Person(int personID) { | |
database = Database() | |
} | |
public getName() { | |
name = database.getName(personID) | |
} | |
public getAddress() { | |
address = database.getAddr(personID) | |
} | |
public getPhone() { | |
phone = database.getPhone(personID) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment