none
How to combine MVVM pattern and N-Tier Architecture RRS feed

  • Question

  • Hi

    I read this thread but still i'm confusing by using MVC specially MVVM patterns in N-Layer architecture.

    when we create a 3-layer application, we have DAL,BLL and PL layers.as you know, there is several way to implementing this architecture,using LINQ to SQL, ADo.Net entity framework or cusomt entities and ...

    know if we want to use MVC or MVVM patterns(in wpf application) inside N-Tier,what change we should make in our architecture?Where will be go the Models,Controllers and ViewModels? in DAL?in BLL? or ...?

     

    Saturday, July 3, 2010 5:21 PM

All replies

  • Greetings,

     

    In the MVVM  ie Model - ViewModel - Model. Here the Model is the part  that will communicating with the BLL <==> DAL <==> SQL SERVER 2008 or 2005. MVVM is mainly got  advantages, mainly due unit testing and the developers can different layers ie some developers can work mvvm and other developers can work on bll and dal.

    Very thing in MVVM is loosely coupled.

    Alot of the examples of MVVM patterns are avaliable , you need it is the model which will be communicating with BLL or communicating with WCF <==>BLL <==>DAL <==> database.

    Hope this helps

    Take Care

    PL

     


    Helping People To Solve Technical Problems
    Saturday, July 10, 2010 2:55 AM
  • Hi PL

    So would you then recreate context for every op in BLL?

    Let's say I have wpf+entity framework app and this app has fairly data-intensive tabs. When the user opens a tab I want to create a new context for it, then the user does whatever and once he/she is finished with it the app can close it and dispose of the context for that tab. I'm curious how would that fit with n-tier(probably should say n-layer) approach. How can I dispose of the context?

    Nick

    Monday, July 26, 2010 8:24 AM