我想使用设计模式来实现资源池,这样实现就会很整洁和灵活。我需要创建的资源有很高的内存开销。是否有适合池化性质或适合其实现的设计模式?
谢谢!
发布于 2014-06-22 22:13:21
来自POSA3的Resource Pool和Resource Cache模式可能很有用,而且肯定是灵活的。这里有一个参考:
Pattern-Oriented Software Architecture Volume 3, Patterns for Resource Management, Michael Kircher, Prashant Jain, John Wiley & Sons Ltd, 2004.
你会找到downloads of source code in various languages的。
还有一些来自Doug Schmidt课程的PowerPoint slides,解释了资源管理上下文中的池化。
您将找到来自POSA3作者的explanation of Pooling。
https://stackoverflow.com/questions/24344877
复制相似问题