CloudCoders / Design-Patterns

Project for learning and discuss about design patterns
16 stars 1 forks source link

Added Memento pattern #40

Open Cotel opened 7 years ago

Cotel commented 7 years ago

Close #20

I think this pattern has no sense in Kotlin. We could join Originator and Memento and we could make CareTaker dissappear because it is only a wrapper of a List of Mementos. Memento has a immutable state and if you want to modify it's state you would create a new Memento with another state and store them in a List in case you want to get back to some of them.

What do you think?