When this happens, our new px_thaw method will create a Set::Object instance and place the contents of the Memento object in it.
当这个操作发生时,我们新的 px_thaw 方法将创建 Set::Object 实例并把 Memento 对象的内容放入其中。
But, fundamentally, reuse via design patterns is fine-grained: one solution (the Flyweight pattern, for example) is orthogonal to another (the Memento pattern).
但是,从根本上来说通过模式实现重用属于细粒度操作:一个解决方案是(比如享元(Flyweight)模式)与另一个解决方案(备忘录模式)正交。
The Memento (316) pattern is a good example.
备忘录模式是一个很好的例子。
应用推荐