I’m thinking of implementing the state design pattern on an ASP .NET Webform.
The state would be determined by the query string passed to the page. Based on the state of the page, any action would call the method on the concrete implementation.
What I am trying to achieve is a page that can handle any number of different implementations of the same general functionality.
My questions are:
Will this work?
Does this sound like the right approach?
I think what you are suggesting would be a sound approach. The only advice I can really offer is to not get hung up on implementing the State Pattern perfectly. I think it would be perfectly acceptable to just have a switch which calls a method based on a query string value.