Building a forum application, Part 9

by Jakobsson 15. August 2009 16:22

This is the ninth part in a series of posts where I build a forum application. The other posts can be found here:

I have now been refactoring quite a bit more. This time I have been focusing on the views and controllers. I have refactored the way I handle the model on my view. Before I have used a "data everywere" approach. I didn't realy like how that turned out, so I decided to go for some other alternative.

I do now use my domain entities as model for my display views instead. If I need to use data from more then one entity I create a viewmodel and put references to the once I need there instead. I have also created something I call "Form models". Those are models I use for my forms and for parameters to my post actions. I did also take all my forms in the application and put them in seperate partial views that are strongly typed to the kind of form model that the post action expects. This way I can use the TextBoxFor() html extension and eliminate a few "magic strings".

I am now pretty happy with how I handle this and I think I'll now move on with the programing of the application. I will now start working a little bit on the admin part of the application.

You can download the application here, or use my svn repository at: https://87.237.213.147:8443/svn/Mattias_Forum with username "User" and no password.

Tags:
Categories: Jakobsson forum

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading