object-oriented programming (OOP)

转载 2012年03月30日 21:54:28

Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.

The programming challenge was seen as how to write the logic, not how to define the data. Object-oriented programming takes the view that what we really care about are the objects we want to manipulate rather than the logic required to manipulate them. Examples of objects range from human beings (described by name, address, and so forth) to buildings and floors (whose properties can be described and managed) down to the little widgets on your computer desktop (such as buttons and scroll bars).

The first step in OOP is to identify all the objects you want to manipulate and how they relate to each other, an exercise often known as data modeling. Once you've identified an object, you generalize it as a class of objects (think of Plato's concept of the "ideal" chair that stands for all chairs) and define

the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. A real instance of a class is called (no surprise here) an "object" or, in some environments, an "instance of a class." The object or class instance is what you run in the computer. Its methods provide computer instructions and the class object characteristics provide relevant data. You communicate with objects - and they communicate with each other - with well-defined interfaces called messages.

The concepts and rules used in object-oriented programming provide these important benefits:

  • The concept of a data class makes it possible to define subclasses of data objects that share some or all of the main class characteristics. Called inheritance, this property of OOP forces a more thorough data analysis, reduces development time, and ensures more accurate coding.
  • Since a class defines only the data it needs to be concerned with, when an instance of that class (an object) is run, the code will not be able to accidentally access other program data. This characteristic of data hiding provides greater system security and avoids unintended data corruption.
  • The definition of a class is reuseable not only by the program for which it is initially created but also by other object-oriented programs (and, for this reason, can be more easily distributed for use in networks).
  • The concept of data classes allows a programmer to create any new data type that is not already defined in the language itself.

Simula was the first object-oriented programming language. Java, Python, C++, Visual Basic .NET and Ruby are the most popular OOP languages today. The Java programming language is designed especially for use in distributed applications on corporate networks and the Internet. Ruby is used in many Web applications. Curl, Smalltalk, Delphi and Eiffel are also examples of object-oriented programming languages.

OOPSLA is the annual conference for Object-Oriented Programming Systems, Languages and Applications.


1. Simple class This example shows how to create a simple employee class. The constructor method is ...
  • arron99
  • arron99
  • 2005年03月01日 09:47
  • 400

面向对象编程(Object-Oriented Programming)

面向对象编程(Object-OrientedProgramming) 基于对现实世界的规律的抽象 (一)基本概念 1.类(class):一类事物的总称 类就是一个模板,用于生成实例的内存空间。 2.实...
  • u012867040
  • u012867040
  • 2017年05月06日 19:49
  • 191

《Object-Oriented Programming With ANSI-C》之第四章(继承——代码重用和改进)

第四章     继承——代码重用和改进   4.1 一个超级类——点        我们将在这章以一个基本的画图程序作为开始。这里是是我们乐意拥有的其中一个类的快速测试如下: #include...
  • besidemyself
  • besidemyself
  • 2011年07月06日 13:35
  • 2539

OOPC:Object-Oriented Programming in C

转载自:http://www.cnblogs.com/stli/archive/2010/10/16/1853190.html  OOPC是指OOP(Object-Oriented Progra...
  • tanlon_0308
  • tanlon_0308
  • 2015年04月28日 17:53
  • 798

《Object-Oriented Programming With ANSI-C》之序言

ANSI-C面向对象程序设计        前言   没有万能的编程技术 没有只产生正确的结果的编程语言 不是每个项目的编程都是从零开始的     面向对象程序设...
  • besidemyself
  • besidemyself
  • 2011年04月30日 14:50
  • 4632

Python 3 Object-Oriented Programming, Second Edition.pdf 英文原版 免费下载

  • jiongyi1
  • jiongyi1
  • 2017年12月04日 23:37
  • 103

面向对象程序设计(Object-oriented programming,OOP)

面向对象程序设计(Object-oriented programming,OOP)
  • qq_28254783
  • qq_28254783
  • 2017年09月13日 14:04
  • 193

The characters of OOP(object-oriented programming)

1.Everything is an object. Think of an object as a fancy variable; it stores data, but you can “make...
  • wfcalyf
  • wfcalyf
  • 2013年06月17日 17:05
  • 119

面向对象编程(Object-oriented programming,OOP)

1、在C++中,基类必须指出希望派出类重定义哪些函数,定义为virtual的函数是基类期待派生类重新定义的,基类希望派生类继承的函数不能定义为虚函数。 2、在C++中,通过基类的引用(或指针...
  • mdtkzc
  • mdtkzc
  • 2014年12月09日 20:13
  • 195

OOP: An Overview [Object-Oriented Programming]

OOP: An Overview
  • flamehaze1115
  • flamehaze1115
  • 2017年10月09日 19:11
  • 29
您举报文章:object-oriented programming (OOP)