问题描述
我讨厌使用不能让简单的事情变得简单的过度设计的 API.尽管如此,我正在为一个开源库设计一个 API,我开始觉得我陷入了过度设计的陷阱.我真的不能确定,因为,当然,我写了该死的东西,所以它的工作原理对我来说比其他任何人都更明显.从开发人员的角度来看,您的 API 可能被过度设计有哪些警告信号?
I despise working with overengineered APIs that don't make simple things simple. Nonetheless, I'm working on designing an API for an open-source library and I'm starting to feel that I'm falling into the overengineering trap. I really can't tell for sure because, of course, I wrote the darn thing, so how it works is more obvious to me than anyone else. What are some warning signs from a developer's perspective that your API might be overengineered?
推荐答案
"从开发人员的角度来看,您的 API 可能被过度设计有哪些警告信号?"
"What are some warning signs from a developer's perspective that your API might be overengineered?"
没有用例.
如果您无法通过简单的执行此操作"场景,那么您就没有考虑到特定用例来设计有用的 API.
If you can't run through simple "to do this" scenarios, you're not designing a useful API with specific use cases in mind.
你的文档应该是那些用例.
Your documentation should be those use cases.
不直接解决用例的功能可能是过度设计的.
Features that don't directly address the use cases are probably over-engineering.
这篇关于API 何时过度设计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!