I found this example for the decorator pattern in a text book.
If we considered the object:
LockedStack MyStack = new LockedStack(new UndoStack(new Stack()))
How can I call the function undo on it?
MyStack.delegate.undo()
won't work because delegate
is private.
Does this example not work in this situation or am I missing something?
Aucun commentaire:
Enregistrer un commentaire