I have this scenario in most of the WindowsForms having grids I have a sequence of code which is similar - AddNewRow(in grid),CreateNewEntity,notifyUser,few other steps Now, I want to use a template kind of pattern.But,my issue is with CreateEntity method since sometimes it is passed a parameter which is different depending on the type of object being created.Should I make createentity accept an "object" type,and cast when the parameter is to be used.What other way can I tackle this design issue? Also,CreateEntity returns the object being created.
Actually, my scenario has MVP pattern.Now,most of the interaction between presenter and view in most forms is the same - user clicks add,a new row is added with some default values for the entity(to show in the grid),n some other common stuff