Skip to content

Instantly share code, notes, and snippets.

@ScottG489
Created August 7, 2013 01:22
Show Gist options
  • Save ScottG489/6170429 to your computer and use it in GitHub Desktop.
Save ScottG489/6170429 to your computer and use it in GitHub Desktop.
// 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