0

I work for a company that has a complex WinForms application that I would like to help refactor, but it is going to be a daunting task unless some standards are decided upon and we find a way to automate the process a bit. Since I am a huge Ruby on Rails fan, I was hoping that there was something similar in the WinForms development environment that was similar to the scaffold/controller/model generators in Rails. My thought that was each form and different feature could be understood to the point where generating boilerplate MVC code with the properties and interactions between M-V-C in place and the functionality more easily transplanted from one place into the corresponding MVC group would be one way to go.

Is anyone aware of any generators out there that do something at least similar to what I want to do here? Any and all suggestions are welcome and appreciated. Thanks!

Jake Smith
  • 2,332
  • 1
  • 30
  • 68
  • Short answer: no. WinForms is a decades old technology. If you're refactoring anyway, why not move to WPF? – Jason Watkins May 18 '15 at 20:20
  • That's also a great idea. We have discussed that and due to specific circumstances, we don't have time to make that jump in the near future. This was something that I was hoping I could surprise the team with and not introduce it into our sprints until I had a proven way of going about improving the refactoring effort. – Jake Smith May 18 '15 at 20:22

2 Answers2

1

As a suggestion, look into the MVP pattern before MVC. MVP is more natural for Winforms and Webforms. See this SO post to compare the two. Also, I'll cite this as a source for the "more natural" comment.

P.S: This is more of a comment, but I don't have 50 rep :)

Community
  • 1
  • 1
Ryan Tankersley
  • 193
  • 1
  • 1
  • 5
  • Thanks for your input. Good reads. I've read about these paradigms before, and I guess my question was really more about how I could get it done quicker, and not as much how do I use these patterns. – Jake Smith May 20 '15 at 16:15
  • Also, it looks like you DO have a rep of 50. Is that pretty recent? – Jake Smith May 20 '15 at 16:15
0

As a suggestion too, Refactor major business logic as much as possible. And put in some static classes. So that get ready to move to MVC.

  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – user353gre3 Nov 01 '15 at 16:40
  • Thank you, Binaya. Code generation based on a schema, e.g. Xml or database or other metadata. I may need some details on what data source Jake is using, then we can give him more suggestion. – ntier ontime Nov 01 '15 at 19:38