开发者

Is there a standard naming convention for implementations of interfaces that seem standard/default?

Trying to code to an interface so that unit testing and d开发者_如何学运维esign are better. Some things that I am coding doesn't seem to have any other implementation other than the obvious one. Is there a naming convention for this?


If you've only got one implementation, why not name your interface after it? You can always refactor the name later, if a second implementation comes along.

Most of the time, we do name our interfaces after the implementation that inspired them. If we then find that we get a second implementation of that interface, we'll either rename the original implementation to be more specific or rename the interface to be more general.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜