V2EX  ›  英汉词典

Abstract Factory

Definition / 定义

(软件工程)抽象工厂:一种创建型设计模式,提供一个接口,用来创建一组相关或相互依赖的对象,而无需指定它们的具体类。常用于需要在“产品族”(如不同操作系统/主题的一整套组件)之间切换的场景。

Pronunciation / 发音

/ˈæb.strækt ˈfæk.tər.i/

Examples / 例句

An abstract factory can create buttons for different operating systems.
抽象工厂可以为不同的操作系统创建按钮。

By using an abstract factory, the UI layer depends on interfaces, so we can swap the entire theme without changing client code.
通过使用抽象工厂,界面层只依赖接口,因此我们可以在不修改客户端代码的情况下切换整套主题。

Etymology / 词源

“Abstract” 来自拉丁语 abstractus(“抽离出来的、概念性的”),强调“面向接口/概念而非具体实现”;“Factory” 源于拉丁语词根 facere(“制作、做”),在编程语境中指“创建对象的地方/方法”。“Abstract Factory” 作为固定术语主要由《Design Patterns》(GoF)推广并系统化。

Related Words / 相关词

Literary Works / 文学作品

  • Design Patterns: Elements of Reusable Object-Oriented Software(Erich Gamma 等,“四人帮”)
  • Head First Design Patterns(Eric Freeman 等)
  • Patterns of Enterprise Application Architecture(Martin Fowler)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   667 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 19:33 · PVG 03:33 · LAX 11:33 · JFK 14:33
♥ Do have faith in what you're doing.