由程序人员进行面向对象的思考

发布于 2024-10-05 07:01:21 字数 131 浏览 5 评论 0原文

我正处于学习cakephp的阶段,这是一个基于OO的框架,但我对OO还没有很好的理解。我来自C程序领域。

我需要一些可以帮助我从面向对象的角度思考的东西。你能告诉我我可以做什么/阅读/观看......以帮助我以面向对象的方式思考吗?

I'm on the stage of learning cakephp, which is a OO based framework, but i have not a good understanding of OO. I come from C procedural field.

I need something which can help me think in OO perspective. Can you advicxe me about what can I do/read/watch.... in order to help me think in OO.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

九厘米的零° 2024-10-12 07:01:21

你需要理解五个概念:类;继承;私人和公共的概念;抽象;多态性。最后两个是最难理​​解的。

为此,不需要一本书。只需阅读有关 OO PHP 的任何教程即可。尝试编写一些模拟类,使用继承和多态性。确保您理解这五个概念,直到您听到这个词时不必思考就能记住它们是什么。

然后,一旦您理解了所有这些,就可以购买一些有关 OOP 的书籍(Boris Pavlovic 所建议的《Head First》是一个不错的选择)。

然后,阅读有关设计模式的信息,即使您不打算使用它们:框架使用(并且经常滥用!)设计模式,因此您必须了解它们(至少,或多或少了解它们的含义)。

You need to understand five concepts : classes ; inheritance ; the notion of private and public ; abstraction ; polymorphism. Those last two are the trickiest to understand.

No need for a book, for that. Just read any tutorial about OO PHP. Try to code a few mock classes, use inheritance and polymorphism. Make sure you understand those five concepts, up to the point you don't have to think when you hear the word to remember what they are.

And then, once you've understood all that, buy some books about OOP (Head First, as suggested by Boris Pavlovic, is a good choice).

Then, read about design patterns, even though you do not intend to use them : frameworks use (and often abuse !) design patterns, so you will have to understand them (at least, know more or less what they're about).

玉环 2024-10-12 07:01:21

我建议阅读 GoF 设计模式。也许不适合初学者,但这是一个非常有用的知识,它解释了 OOP 的用处。有很多关于设计模式的书籍。

I would advice to read GoF design patterns. maybe not for the beginner, but a really helpful knowledge, it explains for what OOP can be helpful. There are a number of books about design patterns.

不再让梦枯萎 2024-10-12 07:01:21

如果你想对OOP有一个大概的了解,可以参考《面向对象的思维过程》一书。

If you want to get the general understanding of OOP, you can refer the book "Object Oriented Thought Process".

猫七 2024-10-12 07:01:21

Head First:面向对象的分析与设计是一本非常好的书,可能是其次是同一系列的简单介绍:设计模式

Head First: Object Oriented Analysis and Design is a very good book which may be followed by Head First: Design Patterns from the same series.

﹎☆浅夏丿初晴 2024-10-12 07:01:21

一般来说,需求中的名词会转化为应用程序中的类。
这不是经验法则,但在大多数情况下都会发生。

请看一下这本书 Arthur-Riel 的面向对象设计启发式。

Generally,Nouns in requirements translates to classes in your application.
This is not a rule of thumb but happens in most cases.

Please give a look at this book Object-Oriented-Design-Heuristics by Arthur-Riel.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文