OOP - 如何选择可能的对象候选者? [英] OOP - How to choose a possible object candidate?
问题描述
我关心应该使用什么技术来选择 OOP 中的正确对象
I 'm concern about what techniques should I use to choose the right object in OOP
关于如何选择对象,有关于 OOP 的必读书籍吗?
Is there any must-read book about OOP in terms of how to choose objects?
最好,
推荐答案
只要写一些可以完成工作的东西,即使它很丑,然后不断重构:
Just write something that gets the job done, even if it's ugly, then refactor continuously:
但是:
这不是一个精确的食谱,只是一些一般准则.继续练习.
It's not a precise recipe, just some general guidelines. Keep practicing.
附言
代码对象不与有形的现实生活对象相关;它们只是将相关信息结合在一起的结构.
Code objects are not related to tangible real-life objects; they are just constructs that hold related information together.
不要相信 Java 书籍/学校教的关于对象的内容;他们在撒谎.
Don't believe what the Java books/schools teach about objects; they're lying.
这篇关于OOP - 如何选择可能的对象候选者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!