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.

相关文章推荐

Chapter 1 Object Oriented Programming (OOP)

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和...

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

面向对象编程

Object Oriented Programming(OOP)

Object Oriented Programming (OOP) Java is a computer programming language that is concurrent, class...

OOP(Object Oriented Programming 面向对象程序设计)

OOP(Object Oriented Programming 面向对象程序设计) 一 2010/08/17 05:35 是一种计算机编程架构。OOP 的一条基本原则是计算机程序是由单个能够起到子程序...

[Object-Oriented Programming] Midterm Project

the requirement:  The Personal Diary is a CLI (Command Line Interface) software, consists of thre...

Object Oriented Programming in C

Embedded software development is slowly moving towards object orientedanalysis, designand programmin...

OOPC:Object-Oriented Programming in C

转载自:http://www.cnblogs.com/stli/archive/2010/10/16/1853190.html  OOPC是指OOP(Object-Oriented Progra...

[Tech Note] Things you better know about object-oriented programming

Introduction This article introduces several valuable zhishizhishi

《Object-Oriented Programming With ANSI-C》之第二章(动态链接和泛函数)

第二章 动态链接和泛函数 2.1 构造器和析构器        让我们来实现一个简单的字符串数据类型,这个数据类型将在接下来的集合中用到。对于新的字符串,我们分配一个动态缓存来保存字文本。当...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)