Skip Navigation LinksHome / News / View News

MVVM with Prism 101 – Part 5b: ServiceLocator vs Dependency Injection

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Nov 03, 2009
(0 votes)

Now that Mark J. Miller showed the View-Model in Part 5, it;s time to see how to wire up the View-Model to the View.

First, let me define a few things. First, Inversion of Control is a pattern wherein creation of objects is delegated in an effort to simplify instantiation and/or defer it until runtime. Huh? Inversion of Control is a means of programming against interfaces. Your classes reference interfaces at design-time and then delegate the creation of the concrete classes to a single component or service. The result is you now have a only a single dependency – the “Container” – instead of a complex hierarchy of dependencies.

You can find Mark's previous parts here:

  • Part 1: The Bootstrapper
  • Part 2: The Shell
  • Part 3: Regions
  • Part 4: Modules
  • Part 5: The View-Model
  • Share


    Comments

    Comments RSS RSS
    No comments

    Add Comment

     
     

       
      
      
       
    Please add 8 and 5 and type the answer here:

    Join the free SilverlightShow webcast 'Running Silverlight Outside the Browser and with Elevated Trust'. Sept 7th, 8 am - 9 am PDT.
    In this live session Chris Anderson will cover configuring and debugging OOB mode, toast notifications, elevated trust, direct file access and much more.
    Learn more | Register | See more webinars (hide this)