quanke
设计模式Java版

Updated 2 years ago

Damon Xu (@damonx) started discussion #38

10 months ago · 0 comments

Open

在享元模式中引入了享元工厂类,享元工厂类的作用在于提供一个用于存储享元对象的享元池,当用户需要对象时,首先从享元池中获取,如果享元池中不存在,则创建一个新的享元对象返回给用户,并在享元池中保存该新增对象。典型的享元工厂类的代码如下:

实现对象的复用——享元模式(二) (Edit this file)

可考虑用泛型

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant