4

I have pretty much finished my first WPF project after several weeks. Now I want to refactor and make my application as clear / reusable as possible.

Does it take a lot of work (meaning would certain logic change entirely?) to change an entire application to the MVVM pattern and would it make the application easier to understand? Also are there other things I should look into except for MVVM?

Basically this application will be used by someone other than myself, so my goal is to make this program more simple since it really got over complicated in certain areas.

The general layout of my program consists of:

  • 10 Classes (1 database class using Singleton)
  • 3 HelperClasses
  • 3 UserControlPages
  • Singleton in about 3 classes
user990423
  • 1,397
  • 2
  • 12
  • 32
PeterP
  • 741
  • 1
  • 8
  • 20
  • 3
    Your question is too general. Be more specific. – david.s May 10 '12 at 15:15
  • 2
    A good measure of the difficulty is to see how many times you have specific control references in your code-behind. MVVM ViewModels keep a logical separation from the view so as long as your code behind is decently generic, it might be easy to port to MVVM – ericb May 10 '12 at 15:18

3 Answers3

2

Does it take a lot of work to change an entire application ?

It's hard to say, cause it depends on the concrete project and how it was coded before, but basically it's never a small amount of work.

would it make the application easier to understand?

Would say: no, but it would definitely make it more testable and more scalable.

Also are there other things I should look into except for MVVM?

It, again, depends on the concrete project (what is target client of your project, who will reuse your code, what is the expected scale of your project...)

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
Tigran
  • 61,654
  • 8
  • 86
  • 123
2

Bare in mind that using the MVVM pattern requires a framework, otherwise it is a huge amount of work. I would recommend Caliburn.Micro, and you should investigate the other frameworks available too.

Community
  • 1
  • 1
devdigital
  • 34,151
  • 9
  • 98
  • 120
  • Oh did not know that. What exactly does that involve implement wise? Cause this program will run on a server on several machines but in 2 weeks or so my job there is done. – PeterP May 10 '12 at 16:35
  • 1
    I would read through the documentation at http://caliburnmicro.codeplex.com/documentation – devdigital May 11 '12 at 10:03
1

Refactoring effort will depend upon existing code. If you have loose coupling in mind right from start, it should not take much effort.

Following are links to questions related to getting started with MVVM.

Learning WPF and MVVM - best approach for learning from scratch

MVVM: Tutorial from start to finish?

https://stackoverflow.com/questions/2267903/learning-mvvm-for-wpf

If you have any specific question, update the question to mention it.

Community
  • 1
  • 1
Tilak
  • 30,108
  • 19
  • 83
  • 131