{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

面向对象葵花宝典:思想、技巧与实践

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

面向对象葵花宝典:思想、技巧与实践

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

你可能既了解各种各样的技术,例如,设计模式、SOLID设计原则、UML、Java、C++……也掌握了一大堆的技术名词,例如“封装”、“继承”、“工厂模式”、“开闭原则”,但还是“知其然,不知其所以然”,在实际开发过程中依然不能很好地应用它们。

不管采用“瀑布流程”,还是“敏捷”流程,软件开发流程都可以简单地分为需求分析、系统设计、编码实现、测试部署这几个阶段。在这些不同的阶段中,面向对象起什么作用呢?如何在这些不同的阶段中应用面向对象技术呢?

带着这些问题到本书中寻找答案吧。

Content Description

本书系统地讲述了面向对象技术的相关内容,包括面向对象的基本概念、面向对象开发的流程、面向对象的各种技巧,以及如何应用面向对象思想进行架构设计。在讲述相关知识或技术的时候,除了从“是什么”这个角度进行介绍外,更加着重于从“为什么”和“如何用”这两个角度进行剖析,力争让读者做到“知其然,并知其所以然”,从而达到在实践中既能正确又能优秀地应用面向对象的相关技术和技巧。

Author Description

李运华,十余年软件设计开发经验,经历了电信行业和移动互联网行业,曾就职于华为和UCWEB,先后担任软件开发工程师、系统分析师、架构师等角色。现担任阿里巴巴移动事业群(原UCWeb)资深软件工程师,主要负责架构设计、架构重构、技术团队管理、技术培训。技术上专注于Linux、MySQL、开源技术、系统分析、架构设计,有丰富的需求分析、系统设计、编程的实战经验。喜欢寻根究底,探究技术的原理和本质;每每有所得,喜欢总结下来并分享到博客。虽然热爱技术,但不拘泥于技术,涉猎群书,勇于挑战,从各方面不断提升自己。
Catalogue

第1部分 面向对象基础 1
第1章 面向对象概述 3
1.1 程序设计思想的发展 3
1.2 面向对象语言的发展历史 6
1.3 面向过程 8
1.4 面向对象 9
1.5 为什么要面向对象 11
1.6 面向对象的应用范围 12
1.7 面向对象的迷思 13
1.7.1 面向对象会导致性能降低? 13
1.7.2 面向对象语言=面向对象编程? 14
1.8 小结 16
第2章 面向对象理论 17
2.1 类 17
2.2 对象 23
2.3 接口 26
2.4 抽象类 31
2.5 抽象 32
2.6 三大核心特征 34
2.6.1 封装 34
2.6.2 继承 44
2.6.3 多态 46
2.7 小结 50
第2部分 面向对象实战 53
第3章 面向对象分析和设计全流程概述 55
第4章 需求模型 57
4.1 需求详解 57
4.2 需求的重要性 59
4.3 需求分析 60
4.3.1 需求分析的目的 60
4.3.2 需求分析的方法 63
4.4 用例方法 69
4.4.1 用例的具体写法 70
4.4.2 要画图吗 74
4.5 功能 75
4.6 用例图的陷阱 78
4.7 SSD 79
4.8 FAQ 81
4.9 小结 82
第5章 领域模型 84
5.1 领域建模三字经 84
5.2 找名词 85
5.3 加属性 87
5.4 连关系 88
5.5 FAQ 89
5.6 小结 90
第6章 设计模型 91
6.1 设计模型总览 91
6.2 类模型 92
6.2.1 第一步(照猫画虎):领域类映射 93
6.2.2 第二步(精雕细琢):应用设计原则和设计模式 101
6.2.3 第三步(照本宣科):拆分辅助类 105
6.3 动态模型 106
6.3.1 模型分类 106
6.3.2 建模实践 108
6.3.3 建模技巧 110
6.4 小结 111
第7章 实现模型 112
7.1 编程语言的差异性 112
7.2 C++ 113
7.2.1 类 113
7.2.2 访问控制 114
7.2.3 继承 117
7.2.4 多态 126
7.2.5 抽象类 130
7.2.6 接口 135
7.3 Java 136
7.3.1 类 137
7.3.2 访问控制 138
7.3.3 继承 142
7.3.4 多态 144
7.3.5 抽象类 146
7.3.6 接口 150
7.4 小结 152
第3部分 面向对象技巧 153
第8章 设计原则 155
8.1 内聚 155
8.1.1 内聚究竟是什么 155
8.1.2 内聚的分类 157
8.2 耦合 168
8.2.1 耦合究竟是什么 168
8.2.2 耦合的分类 169
8.3 高内聚低耦合 180
8.4 类设计原则 188
8.4.1 SRP 188
8.4.2 OCP 191
8.4.3 LSP 193
8.4.4 ISP 197
8.4.5 DIP 202
8.4.6 如何应用设计原则 209
8.4.7 NOP 210
8.5 小结 211
第9章 设计模式 212
9.1 设计模式简介 212
9.2 设计模式只是一把锤子 213
9.3 设计模式之道 214
9.3.1 知易行难――设计模式应用的问题 214
9.3.2 拨云见日――寻找设计模式之道 215
9.3.3 庖丁解牛――解析设计模式之道 217
9.3.4 举一反三――活学活用设计模式之道 218
9.4 原则VS模式 219
9.5 模式详解 225
9.5.1 Prototype模式 226
9.5.2 Decorator模式 238
9.5.3 Facade模式 250
9.5.4 Observer模式 264
9.6 小结 274
第10章 UML 275
10.1 UML简介 275
10.2 UML只是语言 275
10.3 UML应用 277
10.4 需求分析阶段 278
10.4.1 用例图 278
10.4.2 用例图的关系 281
10.5 设计阶段 284
10.5.1 类图 284
10.5.2 类关系图 288
10.5.3 动态图 305
10.5.4 结构图 318
10.6 部署阶段 320
10.7 小结 322
第4部分 面向对象架构设计 325
第11章 面向对象架构设计基础 327
11.1 什么是架构 327
11.2 面向对象的架构设计 329
11.3 小结 330

第12章 面向对象架构设计流程 332
12.1 架构设计总体思想 332
12.2 业务架构 333
12.2.1 全新的业务系统 333
12.2.2 已有架构优化 335
12.2.3 业务架构实例:京西商城 336
12.3 领域架构 337
12.4 软件架构 338
12.4.1 第一步:照猫画虎 338
12.4.2 第二步:按图索骥 340
12.4.3 第三步:深思熟虑 342
12.5 小结 344
第13章 面向对象架构设计技巧 345
13.1 架构设计原则 345
13.1.1 客户需求优先原则 345
13.1.2 适当超前原则 347
13.2 架构设计屠龙刀 350
13.2.1 “拆”与“合” 350
13.2.2 “拆”的常见手段 352
13.2.3 “合”的常见手段 362
13.3 优秀架构师特质:创新 366
13.4 小结 367

Introduction

前 言


我最早接触“面向对象”这个词是在大学的选修课“C++语言”这门课程上,当时的教材分为两部分,前面一部分是讲C语言编程,后面一部分是讲C++的面向对象特性。当时觉得“面向对象”这个词很有意思,但由于教材和教学的原因,当时对“面向对象”的理解和认识很粗浅,认为面向对象就是写class。


工作后开始真正地在业务开发中应用面向对象技术,最初也只是按照写class的方式去应用面向对象,但越来越发现不对劲,自己的疑惑也越来越多。例如:


为什么要这样写class,不能那样写class,反正最后都能完成功能啊?


为什么我说要设计这个class,你说要设计那个class,标准是什么?


客户需求都是用自然语言描述的,根本没有类和继承这些面向对象的概念,那这些设计又是如何得出的呢?是拍脑袋还是靠天才的创造,抑或是有章可循?


如何判断面向对象的设计做得好还是不好呢?


带着这些问题,我开始真正地去探索面向对象的世界,于是一头扎进去,发现了一个精彩但又纷繁复杂的世界,各种各样的技术扑面而来,让人目不暇接——设计模式、SOLID设计原则、UML、Java、C++……费了九牛二虎之力,好不容易把这些啃完了,我自信满满地以为掌握了面向对象的精髓,于是又准备到业务开发中大展拳脚,稍微一实践后却发现自己只是掌握了一大堆的技术名词,例如“封装”、“继承”、“工厂模式”、“开闭原则”,但还是“知其然,不知其所以然”,在实际开发过程中依然不能很好地应用。


除此之外,不管采用“瀑布流程”,还是“敏捷”流程,软件开发流程都可以简单地分为需求分析、系统设计、编码实现、测试部署这几个阶段。在这些不同的阶段中,面向对象起什么作用呢?如何在这些不同的阶段中应用面向对象技术呢?我曾经带着这些疑问去问大虾大牛,但没人能够清楚地回答;也曾经到各种面向对象书籍中探索,但没有找到确切答案。


虽然没有直接找到答案,但在这个思考和探索的过程中,也吸收到了更多的知识、技能和思想。随着我对面向对象思想和技术的理解逐渐加深,加上我在工作中不断地实践,很多问题我自己慢慢地竟然想通了,同时也形成了一套完整的面向对象方法论。


在这个过程中,有很多疑惑,甚至有很多痛苦,投入也很大,是对技术的热爱支撑着我一直探索下去,但我相信大部分程序员没有这么大的兴趣去探索,也没有那么多的时间可以投入,所以我就写成了这本书,让更多的程序员更好地掌握面向对象的思想和技巧,享受程序人生,实现自己的梦想!


本书内容


本书内容主要分为4部分。


面向对象基础:通过对面向对象的历史、发展,与面向过程的对比等相关背景知识的介绍,让读者对面向对象有一个更完整的认识;并深入地阐述了面向对象的各种概念,让读者“知其然,并知其所以然”。


面向对象实战:通过一个实例,完整地介绍了面向对象相关技术如何在软件开发流程中落地,整个面向对象的开发流程一环扣一环,步步为营,让读者避免“拍脑袋”、“头脑风暴”式的开发方式。


面向对象技巧:对“内聚耦合”、“设计模式”、“设计原则”、“UML”等最常见的面向对象技术进行了深入和别具一格的阐述,让读者不但知道“what”(是什么),还能知道“why”(为什么)和“how”(如何用)。


面向对象架构设计:讲解了面向对象思想在架构设计中的应用,只要掌握了面向对象的思想,程序员也可以秒变架构师。


由于面向对象相关的知识和技术纷繁复杂,在一本书里面浓缩这么多的知识,对个人而言是一个很大的挑战,加上很多资料都是来自于网络和英文文档,其中错误与疏漏在所难免,希望读者批评指正。


致谢


在本书写作过程中参考了大量的网络资料,包括维基百科、百度百科等,向这些促进知识传播的网络平台致以诚挚的谢意。


个人在探索的过程中,阅读了大量的面向对象相关的书籍和文档,向这些促进面向对象技术发展的前辈致以诚挚的谢意。


特别感谢我就职的优视科技公司(UCWEB),良好的技术氛围、宽松的工作环境、不断发展和成长的业务,为本书的写作创造了良好的外部环境。


衷心感谢父母和妻子,在本书的写作过程中承担了更多的家庭琐事,给予我最大的支持。

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book