thepearson
thepearson

Reputation: 2248

What is it called when an object member returns the object, enabling you to string method calls?

Perhaps I'm just not using the right Google-age. But I am trying to remember what the term is for when you return the object from one of it members to enable you to do something similar:

class obj {
    obj function method()
    {
        return this
    }
}

obj->method()->method()->method()->method()

I used to know this but it has totally escaped me.

Upvotes: 1

Views: 44

Answers (1)

Anurag
Anurag

Reputation: 141879

Method chaining 1, 2

Upvotes: 2

Related Questions