views:

41

answers:

2

I have a tab control that loads panels as each tab is clicked. I want to add State by having the panel created on the first tab load, and then save the panel and retrieve it after that. Would that fit under the repository design pattern or is there a better one to use?

A: 

What is said in comments is true, you should always know what you want to do, however, this does not render design patterns useless. I guess you are looking for the State design pattern.

Gabriel Ščerbák
A: 

One way of doing is a state pattern. But usually you need all possible states an object can be in. If you just want to safe the actual state of an object and use it later on the Memento pattern could be your way to go.

DaClown
Even though in this case there is no undo/rollback feature, this does seem the best fit. Thanks!
Kenoyer130