Reputation: 61
I know the term "pure function" that describes a function whose output is only dependent on the input.
Is there a similar name for a method (function of an object) whose output is dependent only of the input and the state of the object?
Upvotes: 3
Views: 167
Reputation: 263220
Bertrand Meyer, inventor of the Eiffel programming language and author of the book Object-oriented software construction, calls them "query methods".
Upvotes: 1
Reputation: 9293
I would call it state-dependent method
depending on State
(design-pattern) instance of object is in, you get different result (not only output) or extension
Upvotes: 0