13.16. What's Next?

When you start writing real-world MVC applications, you will probably find you have a number of questions about the best way to design your applications (which is somewhat ironic given that MVC stresses convention over configuration).

When dealing with design decision, it can help to keep the following ideals in mind:

  • Aim for a thin controller and fat model—the controller is just responsible for interacting with the view and model and should never contain any logic! OK, I haven't been that strict in this chapter, but you should because it will make your applications much easier to test.

  • Consider whether your application could be easily split or load-balanced across a number of servers easily. If it can, the chances are good that your architecture is pretty clean. If, however, for example you are storing data in session, you might want to reconsider your approach...

  • ASP.NET MVC is a framework to be built on. It allows you access to the raw metal, but this comes at a price: lack of built-in functionality! You will want to take a look into the MVC Contrib project that adds some very useful additional functionality: www.codeplex.com/MVCContrib.

  • In the example, you used dependency injection techniques. Read up on this and IOC containers such as Castle Windsor.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.171.84