What is the definition of an implementation detail? [closed]

僤鯓⒐⒋嵵緔 提交于 2019-11-28 18:17:00

It's a behavior produced by code which may be relied on by consuming code, though that behavior is not specified by the spec the code is written to. Hence, other implementations of the same spec may not exhibit the same behavior, and will break that consuming code. That's why it's bad to rely on them.

For instance, if you were to write some code against a list interface which specified an array sort but not the algorithm it used, and you needed the sort method to be stable, and a version of your code was used with a non-stable sort algorithm, then your code would break.

I'm not aware of the exact formal definition of the term "implementation detail", it generally refers to the concrete implementation of a certain specification.

Take a List for example.

A specification of a List may say that "it is able to hold multiple values with duplicates while preserving order."

From the above, it doesn't mention what kind of backing data structure is used for the List -- for all we know, it may be an array, or a linked list. That is really an implementation detail that is really left up to the implementor of the List.

An "implementation detail" is a decision that is left to be made by the developers, and is not specified at an earlier level (such as a requirement document or, depending on context, an architectural document.)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!