From Wikipedia, the free encyclopedia
工廠方法模式(英文:factory method pattern)係物件導向編程成日用嘅一種軟件設計模式,用工廠(喺 OOP 當中泛指曉建立第啲物件嘅物件)入面嘅方法嚟建立物件而唔係用建構子,途中唔使講明要建立嗰件物件係咩類別;用虛擬碼表達一件曉建立兩個類別嘅物件嘅工廠物件嘅話,段碼就會係好似以下噉[1]:
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.