1-1面向对象初探
变量也是Object
Data: the properties  or status; is the core
Operations: the functions对外能提供的服务,给灯通电或者不通电。
                           map
Problem space --------------Solution space
 
object  oriented(00)
是一种组织  设计 和实现的思想(Designs&Implementations)
 
2-2 面向对象基本概念
对象之间通过message进行信息交换
Object send messages
  Messages are
    Composed by the sender
    Interpreted by the receiver
    Implemented by the methods
  Messages
    May cause receiver to change state
    May return the result
 
Object vs.Class
  Object(cat)
        Represent things,events ,or concepts
        Respond to message at run-time
  Class(cat class)
    Define properties of instances
        Act like types in C++
 
OOP Characteristics
  1.Evertything is an objetct.
  2.A program is a bunch of objects telling each other what to do by sending messages.
  3.Each Object has its own memory make up of other objects.
  4.Every object has a type.
  5.All objects of a particular type can receive the same messages.
 
An object has an interface
  The interface is the way it receives messages.
  It is defined in the class the object belong to.
 
Functions of the interface
  如果有借口,那么可以很方便的换其他东西,做出在程序中可以拆换的东西
  耦合-内聚,耦合性大是我们希望做到的。
  Communication:与外界进行沟通。
  Protection;如果有借口,就可以保护内部的Implementations,外边的借口了还是不变的。
 
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 programmer's hand off portions they should not touch.
  -Allow the class creators to change the interval working of the class without   worrying 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 action.
  Restrict only access to the publicized methods.

C++程序设计-面向对象的更多相关文章

  1. Javascript高级程序设计——面向对象小结

    ECMAScript支持面向对象编程,对象可以在代码执行时创建,具有动态扩展性而非严格意义上的实体. 创建对象方法: 工厂模式:简单的函数创建引用类型 构造函数模式:可以创建自定义引用类型,可以想创建 ...

  2. 6. javacript高级程序设计-面向对象设计

    1. 面向对象设计 1.1 理解对象 1.1.1 属性类型 (1). 数据属性:相当于对象的字段,包含一个数据值的位置,在这个位置可以读取和写入值.数据属性中有4个描述其行为的特性: l [[Conf ...

  3. python程序设计——面向对象程序设计:类

    理解面向对象 基本原则是,计算机程序由多个能够起到子程序作用的单元或对象组合而成 关键性观念是,数据以及对数据的操作封装在一起,组成一个相互依存.不可分割的整体,即对象 python面向对象特性 完全 ...

  4. 2020/06/06 JavaScript高级程序设计 面向对象的程序设计

    ECMAScript虽然是一种面向对象的语言,但是他没有类的概念.所以他的对象也与其他语言中的对象有所不同. ECMA-262定义对象:一组没有特定顺序的值. 6.1 理解对象 创建对象的方法: 1. ...

  5. C++基本程序设计——面向对象程序设计课堂笔记

    主要对老师上课的ppt的笔记整理 C++基本程序设计 1.c++的输入输出 使用cin,cout和流运算符,开头须有 #include<iostream> (1)cin语句:cin> ...

  6. Javascript高级程序设计——面向对象之实现继承

    原型链: 构造函数中都有一个prototype属性指针,这个指针指向原型对象,而创建的实例也有指向这个原型对象的指针__proto__.当实例查找方法时先在实例上找,找不到再通过__proto__到原 ...

  7. Javascript高级程序设计——面向对象之创建对象

    对象创建方法: 工厂方法 构造函数模式 原型模式 组合构造函数和原型模式 寄生构造函数模式 问题构造函数模式 工厂模式: function Person(name, age){ var obj = n ...

  8. Javascript高级程序设计——面向对象之理解对象

    在面向对象语言中都有类的概念,通过类来创建具有属性和方法的对象.而ECMAScript中没有类的概念,ECMAScript中定义了对象:无需属性的集合,其属性值可以包含基本值.对象.或者函数. 在Ja ...

  9. python程序设计——面向对象程序设计:继承

    继承是为代码复用和设计复用而设计的 在继承关系中,已有的.设计好的类称为父类或基类,新设计的类为子类或派生类 派生类可以继承父类的公有成员,但不能继承其私有成员 如果需要在派生类中调用基类的方法,可以 ...

随机推荐

  1. Shell 文本处理命令

    命令:cut –d’:’ -f1, 文件名 #切割处文件列的参数. -d切割字符. -f列的第几个参数. -c1-10指定字符串范围行的第一个到第十个. 命令:sort 文件名 #根据第一列第一个字符 ...

  2. Linux下启动Oracle服务和监听程序

    $ su – oracle $ sqlplus / nolog sql> conn / as sysdba sql> startup                 #启动Oracle,需 ...

  3. vim自动补全头注释与说明

    做个笔记吧. .vimrc autocmd BufNewFile *.c,*.cpp,*.sh,*.py,*.java exec ":call SetTitle()" " ...

  4. Bootstrap3基础 table-responsive 响应式表格

      内容 参数   OS   Windows 10 x64   browser   Firefox 65.0.2   framework     Bootstrap 3.3.7   editor    ...

  5. Lintcode376-Binary Tree Path Sum-Easy

    376. Binary Tree Path Sum Given a binary tree, find all paths that sum of the nodes in the path equa ...

  6. oracle 11 g release 2 安装

    1.下载Oracle 11g R2 for Windows版本 下载地址如下官方网站: http://www.oracle.com/technetwork/database/enterprise-ed ...

  7. SELinux 的初始和基本操作

    SELinux 主要作用就是最大限度地减小系统中服务进程可访问的资源(最小权限原则). 设想一下,如果一个以 root 身份运行的网络服务存在 0day 漏洞,黑客就可以利用这个漏洞,以 root 的 ...

  8. ssm 出现 Method threw 'org.apache.ibatis.binding.BindingException' exception.Invalid bound statement (not found)……

    运行数据库的增删改查时出现 500状态码 并且提示 Method threw 'org.apache.ibatis.binding.BindingException' exception.Invali ...

  9. java笔记 -- java变量与常量的声明

    变量: 在Java中, 每一个变量属于一种类型. double salary int vacationDays; long earthPopulation; boolean done; 命名: 以字母 ...

  10. 关于AndroidStudio 经常弹出TortoiseSVN 同步的解决办法

    我的AndroidStudio在使用时是从TortoiseSVN的文件夹下直接打开的 但是由于svn自己的特点每改一个文件就要跳出来一个svn的对话框 体验极其难受!砍人的心都有了 网上的解决办法都是 ...