What is an object ?

Object = Entity ;

Object may be

  • -- visible or
  • -- invisible

Object is variable in programming languages.

Objects = Attributes + Services

What is Object-oriented

A way to organize

  • Designs
  • Implementations

Objects send messages

Messages are

  • -Composed by the sender
  • -Interpreted by the receiver
  • -Implemented by methods

Messages

  • May cause receiver to changer state
  • May return results

Object vs. Class

OOP characteristics

  • A program is a bunch of objects telling each other what to do by sending messages.
  • Each object has its own memory made up of other objects
  • Every object has a type.
  • All objects of a particular type can receive the same messages.

The Hidden Implementation

Inner part of an object, data members to present its state, and the actions it takes when messages is rcvd is hidden.

Class creators vs. Client programmers

-keep client programmers' hands off portions they should not touch

-Allow the class creators to change the internal working of the class without worrying about how it will affect the client programmers.

Encapsulation

Bundle data and methods dealing with these data together in an object.

Hide the details of the data and the action.

Restrict only access to the publicized methods.

C plus plus study note (one)的更多相关文章

  1. Beginning Scala study note(9) Scala and Java Interoperability

    1. Translating Java Classes to Scala Classes Example 1: # a class declaration in Java public class B ...

  2. Beginning Scala study note(8) Scala Type System

    1. Unified Type System Scala has a unified type system, enclosed by the type Any at the top of the h ...

  3. Beginning Scala study note(7) Trait

    A trait provides code reusability in Scala by encapsulating method and state and then offing possibi ...

  4. Beginning Scala study note(6) Scala Collections

    Scala's object-oriented collections support mutable and immutable type hierarchies. Also support fun ...

  5. Beginning Scala study note(5) Pattern Matching

    The basic functional cornerstones of Scala: immutable data types, passing of functions as parameters ...

  6. Beginning Scala study note(4) Functional Programming in Scala

    1. Functional programming treats computation as the evaluation of mathematical and avoids state and ...

  7. Beginning Scala study note(3) Object Orientation in Scala

    1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...

  8. Beginning Scala study note(2) Basics of Scala

    1. Variables (1) Three ways to define variables: 1) val refers to define an immutable variable; scal ...

  9. TestNG Study Note 1 - Eclipse 插件安装

    TestNG 插件在线安装 Help -> Install New Software -> Add -> Paste TestNG url to Add:  http://testn ...

  10. CCJ PRML Study Note - Chapter 1.6 : Information Theory

    Chapter 1.6 : Information Theory     Chapter 1.6 : Information Theory Christopher M. Bishop, PRML, C ...

随机推荐

  1. Dynamics AX 2012 R2 业务系列-采购业务流程

    在博文Dynamics AX R2 业务系列中,Reinhard对这个系列做了一个规划,下面我们就按照规划开始说业务吧. 国际惯例,从采购开始. 1.采购的主要职责 简单点说,采购的主要职责,是从供应 ...

  2. dataRow转化为对象

    对象类名useInfo,int,short,string,DateTime格式如下: userInfo.ErrorTimes = int.Parse(dataRow["ErrorTimes& ...

  3. 【GO】GO语言学习笔记二

    基本类型: 布尔型:boolean 整型:int8,byte,int16,int,uint,uintptr等 浮点型:float32,float64 复数类型:complex64,complex128 ...

  4. MySQl查询区分大小写的解决办法

    通过查询资料发现需要设置collate(校对) . collate规则: *_bin: 表示的是binary case sensitive collation,也就是说是区分大小写的 *_cs: ca ...

  5. SQLServer控制用户访问权限表

    连接地址:http://www.cnblogs.com/yxyht/archive/2013/03/22/2975880.html 一.需求 在管理数据库过程中,我们经常需要控制某个用户访问数据库的权 ...

  6. property animation ( NineOldAndroid )

    区别一:需要的Anroid API level不一样 Property Animation需要Android API level 11的支持,而View Animation则是更早期的版本. 区别二: ...

  7. PHP: 深入pack/unpack

    https://my.oschina.net/goal/blog/195749 PHP作为一门为web而生的服务器端开发语言,被越来越多的公司所采用.其中不乏大公司,如腾迅.盛大.淘米.新浪等.在对性 ...

  8. redis 常用配置

    参数说明 redis.conf 配置项说明如下: 1. Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程 daemonize no 2. 当Redis以守护进程方式 ...

  9. XML特殊符号

    在XML中"<" 字符和"&"字符是严格禁止使用的.要使用这几种字符需要使用它们的实体, 下面是五个在XML文档中预定义好的实体:< < ...

  10. TFS二次开发系列:二、TFS的安装

    本系列的实例将采用TFS 2012+Sql Server2012编写. TFS的完整版本安装最好是在Windows server2008 64位以上版本中,其包括64位的SQL SERVER 2012 ...