Khác biệt giữa bản sửa đổi của “Factory method”

Nội dung được xóa Nội dung được thêm vào
Không có tóm lược sửa đổi
Không có tóm lược sửa đổi
Dòng 1:
[[Image:FactoryMethod.svg|thumb|right|300px|Factory method in [[Unified Modeling Language|UML]]]]
[[Image:Factory Method pattern in LePUS3.png|thumb|right|300px|Factory Method in [[Lepus3|LePUS3]]]]
TheMẫu thiết kế Factory ('''factory method pattern''') là một mẫu thiết kế hướng isđối antượng [[object-oriented]] [[design pattern (computer science)|design pattern]].
Like other [[creational pattern]]s, it deals with the problem of creating [[object (computer science)|objects]] (products) without specifying the exact [[class (computer science)|class]] of object that will be created.
The factory method design pattern handles this problem by defining a separate [[method (computer science)|method]] for creating the objects, which [[subclass (computer science)|subclasses]] can then override to specify the [[derived type]] of product that will be created. More generally, the term ''factory method'' is often used to refer to any method whose main purpose is creation of objects.