clyfe
clyfe

Reputation: 23770

What is the name for instance variable caching?

The technique of caching instance variables has a specific "academic" name but I can't remember it. Please help me out.

def current_user
  @current_user ||= User.find(session[:user_id])
end

Marshaling is called Marshalling.
Lazy loading is called lazy loading.
The described technique is called ... ?

Upvotes: 1

Views: 318

Answers (2)

flq
flq

Reputation: 22849

The definition of memoization is defined at wikipedia to avoid repeating "calculations"

Upvotes: 1

Dylan Markow
Dylan Markow

Reputation: 124429

Memoization. http://en.wikipedia.org/wiki/Memoization

Upvotes: 4

Related Questions