OOP concepts confusion?

2019-03-20 12:03发布

While reading some programming books, I notice that the authors says that, in OOP, you may have some confusion while understanding the main idea of OOP.

And hell yeah!. I had some confusion. Did you have the same and what makes this confusion to programmers(even experienced programmers)?!

And if you had it, how could you beat this ?!

Thanks

标签: oop
9条回答
冷血范
2楼-- · 2019-03-20 13:00

The Animal trope works when explaining it to most people.

(Further useful links here and here)

查看更多
We Are One
3楼-- · 2019-03-20 13:00

A lot of the confusion when learning OOP comes from trying to pick the right relationship between objects and classes of objects, particularly whether:

  • Object contains Some other Object (or Object1 has an Object2)
  • Object is an instance of Class

If I can think of a good example that shows a case where either might be appropriate, I'll add it...

查看更多
爷、活的狠高调
4楼-- · 2019-03-20 13:02

Once you understand the oo basics take a look at design patterns and design principles (e.g. by reading Head First Design Patterns). It will teach you how you should actually use the tools that oo gives you. While this is no substitute for practical experience it can certainly speed up the learning process.

查看更多
登录 后发表回答