What's OOP? In easy steps

来源:互联网 发布:辱妻杀人案 知乎 编辑:程序博客网 时间:2024/04/28 03:02

2004-10-22 15:24:47 Ryan
Originally, we describe the problem as "What to do first, then what to do next...", so a problem is described as a sequence of operations. This is called "procedural" way of solving problem

2004-10-22 15:25:55 Ryan
the "Procedural" way of solving problem is focusing on the sequences of operations needed to resolve the problem. But on the other hand, "data" is described "as needed for operations". They are not focused.

2004-10-22 15:27:40 Ryan
Later, when real world gets more comprehensive, people has found that it's hard (even not possible) to simply describe problems as a sequence of operations: solutions to problems is no longer straight-forward. So some clever men has turned there eyes from operations to data-objects.

2004-10-22 15:29:30 Ryan
Object-oriented way of solving problems, differed from the good-old procedural way, is that people no longer describe the problem as simply a sequence of operations, but trying to break up the problem into different objects, that is, entities with own data and operations.

2004-10-22 15:30:35 Ryan
So the whole problem is becoming the inter-operations between objects. This made the problem into small sub-problems, which are much easier to analysis and implement.

2004-10-22 15:37:11 Ryan
Object-oriented is mostly represented in analysis and design phases. Newer languages like C++, Java or C# have added language-level support to Object-oriented programmings, like "class", "inheritence" and so forth, but you can still use C to write code that implements an oo-design.

 

原创粉丝点击