p.116,line.3-5: オブジェクトを作成するときのインターフェイスだけを規定して、実際にどのクラスをインスタンス化するかはサブクラスが決めるようにする。 FactoryMethodパターンは、インスタンス化をサブクラスに任せる。

p.118,line.17-18: factory methodが2つのクラス階層の間の関係をどのように定義しているかに注意してほしい。それはクラスの組み合わせに関する知識を局所化している。
補足: Factory Method によってクラスの組み合わせに関する知識を局所化しているのに、既存のプログラミング言語では、ソースコード上で必ずしも局所的に表現できない点が問題である。
対応する ConcreteProduct と ConcreteCreator を同一モジュール内で定義する。
ConcreteProduct と ConcreteCreate のペアごとに同一モジュール内で定義することにより、モジュール単位での開発・保守を容易にする。

module framework {
define abstract class Creator {
define abstract Product createProduct();
...
}
define abstract class Product {...}
}
module productA extends framework {
define class CreatorA extends Creator {
Product createProduct() { return new ProductA(); }
...
}
define class ProductA extends Product {
define ProductA(){...}
...
}
}
module productB extends framework {
define class CreatorB extends Creator {
Product createProduct() { return new ProductB(); }
...
}
define class ProductB extends Product {
define ProductB(){...}
...
}
}
p.121, line 17-19:
- テンプレートを用いてサブクラス化を避ける。
先に述べたように、factory method の潜在的な問題点として、適切な ConcreteProduct オブジェクトを生成するためにサブクラスを作成しなければならない点をあげることができる。
カスタマイズするためにはサブクラスを作らなければならず、クラス数が増加する。
ConcreteCreator を Creator のサブクラスとして実装するのではなく、差分として実装する。同様に ConcreteProduct を Product に対する差分として実装する。
factory method が生成したオブジェクトをインスタンス変数に保存する場合、 Creator は ConcreteProduct を知らないので、 Product 型の変数に代入することになる。しかし、ConcreteCreator で ConcreteProduct が必要な場合には、 (downcast を使わないためには)別のインスタンス変数が必要になる。同じオブジェクトを指すのにこれは無駄、また一貫性管理の必要性を生む。 MixJuice では、Product への差分として ConcreteProduct を実現すればひとつの変数で済む。

module m {
define class Product {
define abstract Product();
}
define class Creator {
define Product product;
define void anOperation() { ... product = new Product(); ... }
}
}
module m.implementation extends m {
class Product {
Product() {...}
define void concreteMethod() {...}
}
class Creator {
define void anotherOperation() {
...
product.concreteMethod(); // キャスト不要
...
}
}
}