Building Distributed Applications in ASP.NET MVC at MvcConf 2010 on 7/22/2010

Next week Thursday I will be speaking at MvcConf.  This is a virtual, free conference that has attracted some very heavy hitters MVC hitters to come and chat about their voodoo.  This should be interest sting.

http://mvcconf.com/

Below is the abstract and TOC for my presentation.  If you think I missed something or am watering down the presentation please feel free to contact me to give me your suggestions.

Abstract

In this session we will take a look at a handful of common ways that MVC applications are created along with each approaches pros and cons. We will start with a very simplistic, not so flexible, ecommerce application. This will then be followed by several iterations of refactoring to embrace different design patterns, easier code management, loose coupling, better testability, more flexible deployment options, etc. Our final iteration will put us in a place where we can easily scale the system to include the ability to plug in a distribution layer for remote processing with a little IoC and MVC.

We will start by looking at the traditional demo style application where business logic, data access, and everything in between is handled in a controller – not much different than the bloated code behind of WebForms days. Then we will take a look at how to slowly refactor that type of application into something better. We will take a look at how to move towards the single responsibility principle. Next we will take a look at moving to logical separation of our code using namespaces (creating layers). Then we will move towards physical separation with different class library projects (creating tiers). Once our code is pushed into appropriate buckets we will look at removing tight coupling by implementing dependency injection. Then will be ready to plug in an IoC container (StructureMap in this case) which will allow us to easily swap out our concrete implementation as requirements change with little ripple affect felt by our application. At this point our application will be ready to easily support distributed processing on an as needed basis.

The map from start to finish

  1. Standard MVC demo application
    1. All code in a controller/action, or the view
      1. Domain model
      2. Business logic
      3. Data access (LINQ to SQL)
    2. b. Why is this bad?
      1. Causes code duplication and increased complexity
      2. Tight coupling results in less flexible code
      3. No abstractions and/or leaky abstractions cause unforeseen ripple effects
      4. Not easily testable
      5. Refactoring is more difficult
      6. Deployment options are fairly fixed
      7. Versioning specific parts of the application is not easy
      8. Not compose-able
      9. Not easily distributable
  2. Separating our concerns
    1. Putting code into small singularly focused classes
    2. Why is this better?
      1. More testable
      2. Easier to manage
      3. More reusable
      4. Refactoring gets better
  3. Logical separation (layers)
    1. Moving classes to appropriate namespaces
    2. Why is this better?
      1. Easier to manage
      2. A required step to getting closer to tiers
  4. Physical separation (tiers)
    1. Moving classes into appropriate physical assemblies
    2. Why is this better?
      1. Deployment options become more flexible
  5. Refactoring for dependency injection
    1. Achieving loose coupling with interfaces and constructor injection
    2. Why is this better
      1. Loosely coupled
      2. More compose-able
      3. Easiest to test
  6. Using an IoC container for flexible composition
    1. Implementing an inversion of control (IoC) container – StructureMap
    2. Why is this better?
      1. Dynamically compose-able.
      2. Ultimate flexibility for the developer
      3. Easy to seamlessly slip in new functionality
      4. Capable of supporting distributed processing
  7. Adding a WCF service client and services to support seamless application distribution
    1. Why is this better?
      1. Ability to distribute specific pieces of our applications to other servers
      2. Supporting horizontal scalability gets easier
      3. Vertical scalability can be applied to areas of your application rather than being forced to beef up the entire application

Print | posted on Thursday, July 15, 2010 1:30 PM

Comments on this post

# re: Building Distributed Applications in ASP.NET MVC at MvcConf 2010 on 7/22/2010

Requesting Gravatar...
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
Left by Adidas Shoes on Aug 03, 2010 5:57 PM

# re: Building Distributed Applications in ASP.NET MVC at MvcConf 2010 on 7/22/2010

Requesting Gravatar...
Do you heart the Louis Vuitton handbags before?
It is a very welcome line today, and it well-like by famous people. It is also a popular product by the west countries. We can see that its pattern is unique, and it is limited production. If you like our LV handbags, especially the
Replica Handbags that you are prefer to own, please contract us as soon as possible.z
Left by hehe on Aug 08, 2010 2:56 PM

# re: Building Distributed Applications in ASP.NET MVC at MvcConf 2010 on 7/22/2010

Requesting Gravatar...
Good share,Attractive enough for me ,thanks for your kind share,car dvd player keeps with you at any time.Anybody can tell me where i can buy the best and the cheapest wholesale car dvd player gps,i have to tell him that is viewtech,it will be your right choice.

http://www.cardvd88.com/
Left by car dvd on Aug 11, 2010 8:45 PM

# timberland boots

Requesting Gravatar...
Her head was bowed and when she raised white timberland boots it to look at me, she could barely smile without pain. Her face was disfigured, and timberland classic boat skin so tight from surgical procedures that smiling or laughing was very difficult for her timberland kids waterproof boots . She had suffered terribly from treatment to remove the growths timberland shoes that had so marred her face. We chatted for a while that Sunday morning and agreed to meet for timberland womens premium boots lunch later that week. As it turned out we went to lunch several timberland boots women times, and she always wore a hat during the meal. I think that treatments of some timberland shoe company sort had caused a lot of her hair to fall out. We shared things about our lives. I told her about my women timberland shoes schooling and growing up. She told me that she had worked for timberland 6 inch years for an insurance company. She never mentioned family, and I did not ask. I have thought about her timberland mens custom often over the years and how she struggled in a society that places an incredible premium on looks, class, wealth and all the other fineries of life. She suffered from a disfigurement that cannot be made to look attractive. I know that her condition black timberland boots hurt her deeply. One Sunday womens timberland boots morning, I was told that someone was waiting for me in timberland 6 boots office. The young person who answered the rectory timberland boots door said that it was "the woman who said she left all the notes." When I saw her mens timberland boots I was shocked, since I immediately recognized her from church but had no timberland boots outlet idea that it was she who wrote the notes. She was sitting in a chair in timberland roll top boots office with her hands folded in her lap.
Left by timberland pro boots on Sep 06, 2010 3:12 PM

Your comment:

 (will show your gravatar)
 
Please add 5 and 3 and type the answer here: