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. 手机APP功能测试经验分享2016.06.06

    1.登录时,Android和IOS同样的操作,提示信息不一致: 2.注册等页面切换成横屏容易不兼容.把内存卡去掉,再发送图片.音频.视频容易出错. 3.Android和IOS同样的功能,同样的原型图, ...

  2. 006_Salesforce Sharing 使用说明

    Salesforce Sharing 使用说明 背景说明:Salesforce共享实施记录和其它数据时,需要员工之间共享或多个用户在一个组织间的共享.然而,共享这些数据是有风险的,尤其是当它涉及到敏感 ...

  3. crm软件如何实现企业智能化管理?

    互联网技术的发展,让企业越来越重视客户的感知体验,企业只有适应并接受再逐步转向智能化发展模式,才能在市场竞争中取胜不被淘汰.选择一款适宜企业自身发展的CRM系统,根据自身的具体情况随需而定,企业才能更 ...

  4. 分享一个很早之前写的小工具DtSpyPlus

    几年前写的一个获取windows窗体基本信息和屏幕取色的小工具 ,一直在用. 下载地址 http://files.cnblogs.com/dint/SpyPlus.zip

  5. thinkphp 查询当天 ,本周,本月,本季度,本年度,全部, 数据方法

    数据库字段是createtime 里面保存的是时间戳 <?php /* *按今天,本周,本月,本季度,本年,全部查询预约单数据 * $day 代表查询条件 $cid 代表 公司id *返回arr ...

  6. Linux Shell基础知识

    一.文件系统和安全 chmod命令 chmod命令有两种模式,一种是符号模式,用ugo执行用户,用rwx执行权限:另一种是绝对模式,用八进制不同位置的不同值来代表不同用户的不同权限. 符号模式 chm ...

  7. jQuery 操作 CSS

    jQuery 拥有若干进行 CSS 操作的方法.我们将学习下面这些: addClass() - 向被选元素添加一个或多个类 removeClass() - 从被选元素删除一个或多个类 toggleCl ...

  8. [LeetCode_3] Longest Substring Without Repeating Characters

    LeetCode: 3. Longest Substring Without Repeating Characters class Solution { public: int lengthOfLon ...

  9. Markdown工具之---Typora

    在项目集成阶段中,接口文档是不可避免的,以往的我使用word编辑器编写接口文档,虽然word使用不是很熟练,但是只要在网上下载模板或者自己花时间搞定一个文档格式 基本能一劳永逸.但是还是会有很多问题存 ...

  10. javaScript AJAX

    AJAX的实现 var sAjax = function () { var sendMsg = { url: "", sendType: "POST", Con ...