singleton design pattern
常見(jiàn)例句
- This is demonstrated using the ExceptionHandler class, which again adopts a singleton design pattern.
使用 ExceptionHandler 類可以展示這一點(diǎn),該類也采用了 singleton 設(shè)計(jì)模式。 - Static access is especially useful for implementing the singleton design pattern, where only one instance of class exists.
靜態(tài)訪問(wèn)特別適合實(shí)現(xiàn)單一設(shè)計(jì)模式,在這種模式中只存在一個(gè)類實(shí)例。 - A simple optimization to this code would be to apply the Singleton design pattern to class Empty, because every instance of Empty is identical.
這段代碼的一個(gè)簡(jiǎn)單優(yōu)化是對(duì) Empty 類應(yīng)用同一個(gè)設(shè)計(jì)類型,因?yàn)槊恳粋€(gè) Empty 的實(shí)例都是同樣的。 返回 singleton design pattern