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. Linux 系统开启随机端口数量 调优

    Linux系统随机端口 默认Linux系统开启的随机端口范围为 32768 ~ 65535.客户端连接服务监听端口需要使用到随机端口连接. Linux系统随机端口调优 1.添加内核配置参数:/etc/ ...

  2. Bugku-CTF之flag在index里

      Day15 flag在index里 http://123.206.87.240:8005/post/      

  3. Java基础学习-Java语言概述

    一.Java语言发展史 创始人:詹姆斯·高斯林(James Gosling) 公司:SUN——(Stanford University Network斯坦福大学网络公司) 1995年5月23日,Jav ...

  4. oracle 根据出生日期计算年龄的年月日

    select years,months,abs( trunc( newer_date- add_months( older_date,years*12+months ) ) ) days from ( ...

  5. tomcat的systemctl启动脚本

    最近在做Tomcat的实验,顺便研究了一下tomcat的启动脚本发现一个问题,然后经过多方查阅其他大神的资料,终于解决,现在跟大家分享. tomcat的启动脚本跟别的脚本有稍微区别的原因是他需要识别J ...

  6. Selenium如何在谷歌浏览器模拟H5页面

    一.基于java语言(转载:http://www.mamicode.com/info-detail-1972340.html) public class runtest { WebDriver dri ...

  7. hdu 5564 Clarke and digits 矩阵快速幂优化数位dp

    Clarke and digits Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others ...

  8. ubuntun 18.04 安装google浏览器

    ---恢复内容开始--- 一:下载谷歌浏览器镜像源 sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/ap ...

  9. FileProvider 添加二级目录

    我们在做Android N升级适配的时候 传统的Intent调用文件的方式会被认为不安全的 然后系统需要让我们使用更加安全的FileProvider的方法去构建intent请求 如 拍照,安装新的ap ...

  10. rsync详细配置

    1 说在前面的话 rsync官方网站: https://www.samba.org/ftp/rsync/rsync.html rsync是可以实现增量备份的工具.配合任务计划,rsync能实现定时或间 ...