什么是面向对象编程--Quora上被Vote7.3K的回答(来自Steve Jobs)
2015-07-18 01:23
239 查看
Here, in an excerpt from a 1994 Rolling Stone interview, Jobs explains what object-oriented programming is.
Jeff Goodell: Would you explain, in simple terms, exactly what object-oriented software is?
Steve Jobs: Objects are like people. They’re living, breathing things that have knowledge inside them about how to do things and have memory inside them so they can remember things. And rather than interacting with them at a very low level, you interact with them at a very high level of abstraction, like we’re doing right here.
Here’s an example: If I’m your laundry object, you can give me your dirty clothes and send me a message that says, “Can you get my clothes laundered, please.” I happen to know where the best laundry place in San Francisco is. And I speak English, and I have dollars in my pockets. So I go out and hail a taxicab and tell the driver to take me to this place in San Francisco. I go get your clothes laundered, I jump back in the cab, I get back here. I give you your clean clothes and say, “Here are your clean clothes.”
You have no idea how I did that. You have no knowledge of the laundry place. Maybe you speak French, and you can’t even hail a taxi. You can’t pay for one, you don’t have dollars in your pocket. Yet I knew how to do all of that. And you didn’t have to know any of it. All that complexity was hidden inside of me, and we were able to interact at a very high level of abstraction. That’s what objects are. They encapsulate complexity, and the interfaces to that complexity are high level.
原问题链接:Here
Jeff Goodell: Would you explain, in simple terms, exactly what object-oriented software is?
Steve Jobs: Objects are like people. They’re living, breathing things that have knowledge inside them about how to do things and have memory inside them so they can remember things. And rather than interacting with them at a very low level, you interact with them at a very high level of abstraction, like we’re doing right here.
Here’s an example: If I’m your laundry object, you can give me your dirty clothes and send me a message that says, “Can you get my clothes laundered, please.” I happen to know where the best laundry place in San Francisco is. And I speak English, and I have dollars in my pockets. So I go out and hail a taxicab and tell the driver to take me to this place in San Francisco. I go get your clothes laundered, I jump back in the cab, I get back here. I give you your clean clothes and say, “Here are your clean clothes.”
You have no idea how I did that. You have no knowledge of the laundry place. Maybe you speak French, and you can’t even hail a taxi. You can’t pay for one, you don’t have dollars in your pocket. Yet I knew how to do all of that. And you didn’t have to know any of it. All that complexity was hidden inside of me, and we were able to interact at a very high level of abstraction. That’s what objects are. They encapsulate complexity, and the interfaces to that complexity are high level.
原问题链接:Here
相关文章推荐
- 在MacBook上查看Java的安装路径并设置JAVA_HOME变量
- python深拷贝与浅拷贝
- Struts2数据传输的背后机制:ValueStack(值栈)
- C++ 全局变量 局部变量 静态变量 及 extern
- Struts2中的ModelDriven机制及其运用
- java使用json将HashMap转化成javabean小例子
- HDU 1018 斯特林公式应用
- java:快速文件分割及合并
- jffs2,yaffs2,logfs,ubifs文件系统性能分析
- springmvc 返回 json报406错误
- Category用法
- Java数据库创建于字符编码以及操作
- 一个简单二叉树的C++实现(一)
- python 移动指定目录下的txt文件到另外的目录
- ASP.NET中将声音文件添加到资源中并进行播放的方法
- 详解Django中的form库的使用
- 在Django的视图中使用form对象的方法
- 在Django的URLconf中进行函数导入的方法
- 在Django的URLconf中使用多个视图前缀的方法
- 在Django的URLconf中使用命名组的方法