开发者

What is the name of a method whose output is only dependent of input and the state of the object?

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 met开发者_JS百科hod (function of an object) whose output is dependent only of the input and the state of the object?


Bertrand Meyer, inventor of the Eiffel programming language and author of the book Object-oriented software construction, calls them "query methods".


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜