Skip to Content
Head Firstデザインパターン 第2版 ―頭とからだで覚えるデザインパターンの基本
book

Head Firstデザインパターン 第2版 ―頭とからだで覚えるデザインパターンの基本

by Eric Freeman, Elisabeth Robson, 佐藤 直生, 木下 哲也
June 2022
Beginner to intermediate
672 pages
17h 23m
Japanese
O'Reilly Japan, Inc.
Content preview from Head Firstデザインパターン 第2版 ―頭とからだで覚えるデザインパターンの基本
デザインツールボックスの
ためのツール
 この
4
章では、
Factory Method
と
Abstract Factory
という
2
つのツールがツールボックスに追加されました。どちらのパ
ターンもオブジェクト作成をカプセル化し、コードを具象型
から分離できます。
■
す べ て の ファク トリは オ ブ
ジェクト作成をカプセル化する。
■
Simple Factory
は正確には
デザインパターンではないが、
クライアントを具象クラスか
ら分離するための簡単な方法
である。
■
Factory Method
は継承を
利用する。オブジェクト作成
を、オブジェクトを作成する
ファクトリメソッドを実装し
たサブクラスに委譲する。
■
Abstract Factory
はオブジェ
ク
トコンポジションを利用す
る。オブジェクト作成を、ファ
クトリインタフェースで公開
されたメソッドで実装する。
■
すべての
Factory
パターンは、
アプリケーションの具象クラ
スへの依存度を減らすことで
疎結合を促進する。
■
Factory Method
の目的は、
クラスがサブクラスにインス
タンス化を任せられるように
することである。
■
Abstract Factory
の目的は、
具象クラスに依存せずに一連
の関連オブジェクトを作成す
ることである。
■
依存関係反転の原則は、具象
型への依存を回避し、抽象化
を促す。
■
ファクトリは、具象クラスに
対してではなく抽象に対して
コーディングするための強力
な手法である。
162
 
4
章
デザインツールボックス
1 2
3
4
5 6
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

マッピングエクスペリエンス ―カスタマージャーニー、サービスブループリント、その他ダイアグラムから価値を創る

マッピングエクスペリエンス ―カスタマージャーニー、サービスブループリント、その他ダイアグラムから価値を創る

James Kalbach, 武舎 広幸, 武舎 るみ

Publisher Resources

ISBN: 9784873119762Other