Sunday, February 12, 2012

State Pattern

I am learning about design patterns in depth these days. Amazed by the solutions they give .. Some patterns like abstract factory , factory made sense to me but could not find immediate application to my code .. so could not get that uahaa feeling ;) When i read about the state pattern http://blog.raffaeu.com/archive/2011/02/13/state-pattern-using-c-part-01.aspx .. i found an immediate use for this in all my code. I realized how my code is tightly coupled all these days .. Implemented this and now i have a happy feeling .. I learned something new and implemented it . .................. :) :)

I have a class which as states such as new edit view .. I moved all the logic related to this states using this pattern :)

No comments:

Post a Comment