hsy75的个人空间 https://blog.eetop.cn/vivilife [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

Thinking in JAVA 3

已有 786 次阅读| 2006-12-28 13:37 |个人分类:Reading Notes

天气: 晴朗
心情: 高兴

Introduction to Objects:

The Progress of abstraction:.1 The OOP allows you to describe the problem in terms of the problem,rather than in term of the computer where the solution will run.

what is class:a class is really a data type.

what's object:1. Everything is an object.2. A program is a bunch of objects telling each other what to do by sending messages.3. Each object has its own memory made up of other objects.4. Every object has a type.5. All objects of a particular type can receive the same messages.

what's interface:We know to make a objects to work we should send the message to this objects,but each object can satisfy only certain requests.The requests you can make of an object are defined by its interface, and the type is what determines the interface.So we can say the interface is the type that the message that this kinds of the object can receive.

Why hidden implementation:The author suggesion that we should break up the playing field into class creators (those who create new data types) and client programmers(the class consumers who use the data types in their applications). The goal of the client programmer is to collect a toolbox full of classes to use for rapid application development. The goal of the class creator is to build a class that exposes only what’s necessary to the client programmer and keeps everything else hidden.

composition & aggregation:Your new class can be made up of any number and type of other objects, in any combination that you need to achieve the functionality desired in your new class. Because you are composing a new class from existing classes, this concept is called composition (if the composition happens dynamically, it’s usually called aggregation).

Inheritance:reusing the interface,as author had suggestion,a class is a type which could send out or receive some kinds of messages(by the interface).the inheritance which exactly means that get the same interface from the base class.

overriding:change the behavior of an existing base-class method.


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 1

    好友
  • 2

    获赞
  • 14

    评论
  • 3241

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-29 20:16 , Processed in 0.015263 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部