none
EF 4.1 N Tier ASP .Net confusion - please help! RRS feed

  • Question

  • Hi Guys,

    I hope you can help me out with any advice, it'd be greatly appreciated.

    I've been using EF 4.0 for a while now using the following object context management technique  http://dotnetslackers.com/articles/ado_net/Managing-Entity-Framework-ObjectContext-lifespan-and-scope-in-n-layered-ASP-NET-applications.aspx . I have a fairly simple setup with a web project connecting to a BLL connecting to a DAL. The web and BLL reference the DAL Entity objects. It's been functioning fine but it seems very slow. It's an ASP .NET Webforms application that uses an existing database model (i.,e not code first) and points to a SQL Server 2005 DB.

    Anyway, I'm now revisiting the architecture as we're getting complaints over screen to screen performance. I've done most of the UI enhancements possible but I think it's just the Save, Redirect and Load using EF that's the sluggish point now.

    The site is a series of quote pages for car insurance. I'm now hoping to do create the relevant objects in session, i.e, page 1 create quote object, populate fields, page 2, add X additional drivers, page 3 add claims /convictions and then save the objects to the database. The users will be able to save and exit at any point in the quote process so the save won't always be at the end. We also need to be able to load page 1's info and update it in memory when they click Next and finally update the DB when they're ready to finish the quote.

    At the moment, we're doing the retrieve and saves on the same page. How would you advise we move to the storing in session/final commit?

    I've trawled through various msdn pages and I'm having trouble putting it all together into the latest 'best practice' for 4.1 for this fairly simple application. I've looked at Julie Lerman's videos but her n'tier only did a simple retrieve and 'Add', suspiciously leaving out the Update section as I suspect it is not straightforward. Do you think I should use Self Tracking Entities (I've read that people are having multiple issues with this but maybe their architecture is more complex?) or some other way of storing the EF objects in session and making the changes

    Any help/ideas greatly appreciated.

    Saturday, July 30, 2011 12:28 PM

Answers

  • On 7/31/2011 5:57 PM, RickRiver wrote:
    > *Thanks for replying guys:*
    > *
    > *
    > *@darnold*
    > *
    > *
    > /"You should get the data at one time, all of it and putting the data/
    > /into one object that's carried around in session. The object has all of/
    > /its child objects in it. The only trip you make back to the database is/
    > /to save data from the object and its children objects. You can call it/
    > /the Insurance object./
    >
    > //
    >
    > /If you keep one object is session with all related child objects, then/
    > /you can do a wizard like solution. On the add, the save button will only/
    > /show on the last page. But on an update, the save button is shown on/
    > /every page, and the user can save the data sending the object with its/
    > /children to be persisted to the database."/
    >
    > *This sounds like a good approach at what I'm trying to achieve.*
    >
    > /You would use smart Data Transfer Objects that know their state isNew,/
    > /isOld (not isNew),IsDirty and is Marked for deleteion, which will tell/
    > /that DAL how to do the CRUD operations with the database. Of course,/
    > /you will have to map data between the DTO and the Entity./
    > *I'm not using any DTOs at the moment (the web project refers to our DAL
    > objects direct). Are you suggesting STEs or is there another DTO
    > mechanism that you'd suggest?*
     
     
    If you don't want to use DTO(s), the use Business object that know their
    state.
     
    > /You should also be using complied queries which are keep in static/
    > /memory and makes queries faster, as the complied query stay in static/
    > /memory until the ASP.NET worker process is recycled./
    > *I've used compiled queries in these pages for the initial retrieve on
    > each page.*
    > *@Rune*
    > *Thanks for the hints. I'm not using any DTO objects between the Web ->
    > BLL -> DAL. They're all on the same server so are just referenced direct
    > project to project.*
    > *Any other advice greatly appreciated.*
    >
     
    The pages should be as dumb as possible. You can look at the page I am
    showing that has no code at the UI page itself that is passing control
    to the presenter.
     
     Codebehind file of the UI
     
    using System;
    using System.Collections.Generic;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using MVPDemoWeb.Presenters;
    using MVPDemoWeb.Views;
    using BLL.DTO;
    using ServiceLayer;
     
    namespace MVPDemoWeb
    {
        public partial class ArticleView : Page, IArticleView
        {
             #region Members
            private readonly ArticleViewPresenter mPresenter;
            #endregion
             #region Properties
             public int Idx
            {
                get { return (int)Session["IdxObj"]; }
                set { Session["IdxObj"] = value; }
            }
             public List<DTOArticle> DtoArticles
            {
                get { return (List<DTOArticle>) Session["ArticlesObj"] ;}
                set { Session["ArticlesObj"] = value; }
            }
             public Boolean IsPostback
            {
                get { return Page.IsPostBack; }
            }
             public Label LblArticleId
            {
                get { return LBLArticleID; }
                set { LBLArticleID = value; }
            }
            public TextBox TbxTitle
            {
                get { return TBXTitle; }
                set { TBXTitle = value; }
            }
             public TextBox TbxBody
            {
                get { return TBXBody; }
                set { TBXBody = value; }
            }
            #endregion
             #region Constructors
             public ArticleView()
            {
                mPresenter = new ArticleViewPresenter(this,
    TheService1.Instance);
            }
             #endregion
             protected void Page_Load(object sender, EventArgs e)
            {
                mPresenter.PageLoad();
            }
             protected void btnFirst_Click(object sender, EventArgs e)
            {
                mPresenter.btnFirstClick();
            }
             protected void btnPrev_Click(object sender, EventArgs e)
            {
                mPresenter.btnPrevClick();
            }
             protected void btnNext_Click(object sender, EventArgs e)
            {
                mPresenter.btnNextClick();
            }
             protected void btnLast_Click(object sender, EventArgs e)
            {
                mPresenter.btnLastClick();
            }
             protected void btnUpdate_Click(object sender, EventArgs e)
            {
                mPresenter.btnUpdateClick();
            }
             protected void btnClear_Click(object sender, EventArgs e)
            {
                mPresenter.btnClearClick();
            }
             protected void btnSaveNew_Click(object sender, EventArgs e)
            {
                mPresenter.btnSaveNewClick();
            }
             protected void btnDelete_Click(object sender, EventArgs e)
            {
                mPresenter.btnDeleteClick();
            }
             protected void btnSumbit_Click(object sender, EventArgs e)
            {
                mPresenter.btnSubmitClick();
            }
        }
    }
     
    The Presenter for the Article user interface
     
    using System.Web.UI.WebControls;
    using BLL.DTO;
    using System.Collections.Generic;
    namespace MVPDemoWeb.Views
    {
        public interface IArticleView :IView
        {
            int Idx { get; set; }
            List<DTOArticle> DtoArticles { get; set; }
            Label LblArticleId { get; set; }
            TextBox TbxTitle { get; set; }
            TextBox TbxBody { get; set; }
        }
    }
     
    The Presenter
     
    using System.Collections.Generic;
    using System.Linq;
    using MVPDemoWeb.Views;
    using BLL.DTO;
    using ServiceLayer.IServices;
     
    namespace MVPDemoWeb.Presenters
    {
        public class ArticleViewPresenter
        {
            private readonly IArticleView mView;
            private readonly IService1 mService;
             #region constructor
             public ArticleViewPresenter(IArticleView view, IService1
    theService)
            {
                mView = view;
                mService = theService;
            }
             #endregion
             #region Public Methods
             public void PageLoad()
            {
                if (!mView.IsPostback)
                {
                    mView.DtoArticles = mService.GetArticles();
                    var article = mService.GetArticle(5);
                    mView.Idx = 0;
                    PopulateFields(article);
                }
            }
             public void btnFirstClick()
            {
                mView.Idx = 0;
                PopulateFields(mView.DtoArticles, mView.Idx);
            }
             public void btnPrevClick()
            {
                if(mView.Idx == 0)
                {
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
                else
                {
                    mView.Idx -= 1;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
             public void btnNextClick()
            {
                if (mView.Idx == mView.DtoArticles.Count - 1)
                {
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
                else
                {
                    mView.Idx += 1;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
             public void btnLastClick()
            {
                mView.Idx = mView.DtoArticles.Count - 1;
                PopulateFields(mView.DtoArticles, mView.Idx);
            }
             public void btnUpdateClick()
            {
                var article = mView.DtoArticles[mView.Idx];
                 article.Tille = mView.TbxTitle.Text;
                article.Body = mView.TbxBody.Text;
                article.IsUpdate = true;
            }
             public void btnClearClick()
            {
                mView.TbxTitle.Text = "";
                mView.TbxBody.Text = "";
                mView.LblArticleId.Text = "Article not saved yet.";
            }
             public void btnSubmitClick()
            {
                var atleastonearticle = (from a in
    mView.DtoArticles.Where(a => a.IsUpdate
                                         || a.ArticleID == -1)
                                        select a).FirstOrDefault();
                 if (atleastonearticle != null)
                {
                    mView.DtoArticles =
    mService.SaveArticles(mView.DtoArticles);
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
             public void btnSaveNewClick()
            {
                if (mView.TbxBody.Text != ""
                    && mView.TbxTitle.Text != "")
                {
                    var article = new DTOArticle
                                     {
                                         ArticleID = -1,
                                         AuthorID = 1,
                                         Tille = mView.TbxTitle.Text,
                                         Body = mView.TbxBody.Text,
                                         IsUpdate = false
                                     };
                     mView.DtoArticles.Add(article);
                    mView.Idx = mView.DtoArticles.Count - 1;
                }
            }
             public void btnDeleteClick()
            {
                if (mView.DtoArticles.Count > 0)
                {
                    var article = mView.DtoArticles[mView.Idx];
                    mService.DeleteArticle(article);
                    mView.DtoArticles.RemoveAt(mView.Idx);
                    mView.Idx = 0;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
            #endregion
             #region Private Methods
             private void PopulateFields(DTOArticle article)
            {
                mView.LblArticleId.Text = article.ArticleID.ToString();
                mView.TbxTitle.Text = article.Tille;
                mView.TbxBody.Text = article.Body;
            }
             private void PopulateFields(List<DTOArticle> articles, int idx)
            {
                var article = articles[idx];
                 mView.LblArticleId.Text = article.ArticleID.ToString();
                mView.TbxTitle.Text = article.Tille;
                mView.TbxBody.Text = article.Body;
            }
             #endregion
        }
    }
       > *@Rune*
     > *Thanks for the hints. I'm not using any DTO objects between the Web ->
     > BLL -> DAL. They're all on the same server so are just referenced direct
     > project to project.*
     > *Any other advice greatly appreciated.*
     >
     
    The MVP being  shown here is event driven while the one I am using is
    not event driven, and the WEB controls are on the interface so they can
    be dealt with with by the presenter. I am using a session object that is
    controlled by the presenter too. The UI should be unaware of the BLL
    logic or the DAL thus the DTO(s).
     
    MODEL-VIEW-PRESENTER
     
     
    click 'Shows'
     
    click 'Design Patterns Bootcamp: Model View * Patterns*
     
    view parts  1-5
     
     
    Sunday, July 31, 2011 11:24 PM

All replies

  • Hi,

    I find it a bit strange that you has performance issues in the way you're describing your application. I think it's important for you to first actually identify the problem for your latency by profiling the performance your application to see if you find some bottlenecks. And work from there.

    If you are using a simple BLL and DAL without any special logic except mapping the DTO's to entities it should not be a performance issue that part, so you wouldn't get any improvement here by switching to STE.

    A another thing, you are saying that your application is an N-Tier app, but how do you communicate between the web app and BLL? Is it WCF? Maybe you could optimize the communication between the web app and BLL too.

    As for your question how to design your web app to store objects on final commit, I think you should try the asp.net forums instead, since the people there has more knowlegde on how to do this the most optimal way.

    Finally, it is possible to tune EF performance too, take a look at this link http://msdn.microsoft.com/en-us/library/cc853327.aspx (note: it's for EF 4) and see if this can help you.

    This is not an answer, but I hope this gives you a bit more to work on!

     


    --Rune

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Sunday, July 31, 2011 7:52 AM
  • On 7/30/2011 8:28 AM, RickRiver wrote:
    > Hi Guys,
    >
    > I hope you can help me out with any advice, it'd be greatly appreciated.
    >
    > I've been using EF 4.0 for a while now using the following object
    > context management technique
    > . I have a fairly simple setup with a web project connecting to a BLL
    > connecting to a DAL. The web and BLL reference the DAL Entity objects.
    > It's been functioning fine but it seems very slow. It's an ASP .NET
    > Webforms application that uses an existing database model (i.,e not code
    > first) and points to a SQL Server 2005 DB.
    >
    > Anyway, I'm now revisiting the architecture as we're getting complaints
    > over screen to screen performance. I've done most of the UI enhancements
    > possible but I think it's just the Save, Redirect and Load using EF
    > that's the sluggish point now.
    >
     
    You should get the data at one time,  all of it and putting the data
    into one object that's carried around in session. The object has all of
    its child objects in it. The only trip you make back to the database is
    to save data from the object and its children objects. You can call it
    the Insurance object.
     
    > The site is a series of quote pages for car insurance. I'm now hoping to
    > do create the relevant objects in session, i.e, page 1 create quote
    > object, populate fields, page 2, add X additional drivers, page 3 add
    > claims /convictions and then save the objects to the database. The users
    > will be able to save and exit at any point in the quote process so the
    > save won't always be at the end. We also need to be able to load page
    > 1's info and update it in memory when they click Next and finally update
    > the DB when they're ready to finish the quote.
     
    If you keep one object is session with all related child objects, then
    you can do a wizard like solution. On the add, the save button will only
    show on the last page. But on an update, the save button is shown on
    every page, and the user can save the data sending the object with its
    children to be persisted to the database.
    >
    > At the moment, we're doing the retrieve and saves on the same page. How
    > would you advise we move to the storing in session/final commit?
     
    You can do one retrieve of data putting all objects into a master object
    that's carried around in session passing page to page.
    >
    > I've trawled through various msdn pages and I'm having trouble putting
    > it all together into the latest 'best practice' for 4.1 for this fairly
    > simple application. I've looked at Julie Lerman's videos but her n'tier
    > only did a simple retrieve and 'Add', suspiciously leaving out the
    > Update section as I suspect it is not straightforward. Do you think I
    > should use Self Tracking Entities (I've read that people are having
    > multiple issues with this but maybe their architecture is more complex?)
    > or some other way of storing the EF objects in session and making the
    > changes
    >
     
    You would use smart Data Transfer Objects that know their state isNew,
    isOld (not isNew),IsDirty and is Marked for deleteion, which will tell
    that DAL how to do the CRUD operations with the database.  Of course,
    you will have to map data between the DTO and the Entity.
     
    You should also be using complied queries which are keep in static
    memory and makes queries faster, as the complied query stay in static
    memory until the ASP.NET worker process is recycled.
     
     
    Sunday, July 31, 2011 6:56 PM
  •  

    Thanks for replying guys:

    @darnold

    "You should get the data at one time,  all of it and putting the data
    into one object that's carried around in session. The object has all of
    its child objects in it. The only trip you make back to the database is
    to save data from the object and its children objects. You can call it
    the Insurance object.

     

     

    If you keep one object is session with all related child objects, then
    you can do a wizard like solution. On the add, the save button will only
    show on the last page. But on an update, the save button is shown on
    every page, and the user can save the data sending the object with its
    children to be persisted to the database."

    This sounds like a good approach at what I'm trying to achieve.

       

    You would use smart Data Transfer Objects that know their state isNew,
    isOld (not isNew),IsDirty and is Marked for deleteion, which will tell
    that DAL how to do the CRUD operations with the database.  Of course,
    you will have to map data between the DTO and the Entity.
    I'm not using any DTOs at the moment (the web project refers to our DAL objects direct). Are you suggesting STEs or is there another DTO mechanism that you'd suggest?
     
    You should also be using complied queries which are keep in static
    memory and makes queries faster, as the complied query stay in static
    memory until the ASP.NET worker process is recycled.
    I've used compiled queries in these pages for the initial retrieve on each page.
    @Rune
    Thanks for the hints. I'm not using any DTO objects between the Web -> BLL -> DAL. They're all on the same server so are just referenced direct project to project.
    Any other advice greatly appreciated.

     

    Sunday, July 31, 2011 9:57 PM
  • On 7/31/2011 5:57 PM, RickRiver wrote:
    > *Thanks for replying guys:*
    > *
    > *
    > *@darnold*
    > *
    > *
    > /"You should get the data at one time, all of it and putting the data/
    > /into one object that's carried around in session. The object has all of/
    > /its child objects in it. The only trip you make back to the database is/
    > /to save data from the object and its children objects. You can call it/
    > /the Insurance object./
    >
    > //
    >
    > /If you keep one object is session with all related child objects, then/
    > /you can do a wizard like solution. On the add, the save button will only/
    > /show on the last page. But on an update, the save button is shown on/
    > /every page, and the user can save the data sending the object with its/
    > /children to be persisted to the database."/
    >
    > *This sounds like a good approach at what I'm trying to achieve.*
    >
    > /You would use smart Data Transfer Objects that know their state isNew,/
    > /isOld (not isNew),IsDirty and is Marked for deleteion, which will tell/
    > /that DAL how to do the CRUD operations with the database. Of course,/
    > /you will have to map data between the DTO and the Entity./
    > *I'm not using any DTOs at the moment (the web project refers to our DAL
    > objects direct). Are you suggesting STEs or is there another DTO
    > mechanism that you'd suggest?*
     
     
    If you don't want to use DTO(s), the use Business object that know their
    state.
     
    > /You should also be using complied queries which are keep in static/
    > /memory and makes queries faster, as the complied query stay in static/
    > /memory until the ASP.NET worker process is recycled./
    > *I've used compiled queries in these pages for the initial retrieve on
    > each page.*
    > *@Rune*
    > *Thanks for the hints. I'm not using any DTO objects between the Web ->
    > BLL -> DAL. They're all on the same server so are just referenced direct
    > project to project.*
    > *Any other advice greatly appreciated.*
    >
     
    The pages should be as dumb as possible. You can look at the page I am
    showing that has no code at the UI page itself that is passing control
    to the presenter.
     
     Codebehind file of the UI
     
    using System;
    using System.Collections.Generic;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using MVPDemoWeb.Presenters;
    using MVPDemoWeb.Views;
    using BLL.DTO;
    using ServiceLayer;
     
    namespace MVPDemoWeb
    {
        public partial class ArticleView : Page, IArticleView
        {
             #region Members
            private readonly ArticleViewPresenter mPresenter;
            #endregion
             #region Properties
             public int Idx
            {
                get { return (int)Session["IdxObj"]; }
                set { Session["IdxObj"] = value; }
            }
             public List<DTOArticle> DtoArticles
            {
                get { return (List<DTOArticle>) Session["ArticlesObj"] ;}
                set { Session["ArticlesObj"] = value; }
            }
             public Boolean IsPostback
            {
                get { return Page.IsPostBack; }
            }
             public Label LblArticleId
            {
                get { return LBLArticleID; }
                set { LBLArticleID = value; }
            }
            public TextBox TbxTitle
            {
                get { return TBXTitle; }
                set { TBXTitle = value; }
            }
             public TextBox TbxBody
            {
                get { return TBXBody; }
                set { TBXBody = value; }
            }
            #endregion
             #region Constructors
             public ArticleView()
            {
                mPresenter = new ArticleViewPresenter(this,
    TheService1.Instance);
            }
             #endregion
             protected void Page_Load(object sender, EventArgs e)
            {
                mPresenter.PageLoad();
            }
             protected void btnFirst_Click(object sender, EventArgs e)
            {
                mPresenter.btnFirstClick();
            }
             protected void btnPrev_Click(object sender, EventArgs e)
            {
                mPresenter.btnPrevClick();
            }
             protected void btnNext_Click(object sender, EventArgs e)
            {
                mPresenter.btnNextClick();
            }
             protected void btnLast_Click(object sender, EventArgs e)
            {
                mPresenter.btnLastClick();
            }
             protected void btnUpdate_Click(object sender, EventArgs e)
            {
                mPresenter.btnUpdateClick();
            }
             protected void btnClear_Click(object sender, EventArgs e)
            {
                mPresenter.btnClearClick();
            }
             protected void btnSaveNew_Click(object sender, EventArgs e)
            {
                mPresenter.btnSaveNewClick();
            }
             protected void btnDelete_Click(object sender, EventArgs e)
            {
                mPresenter.btnDeleteClick();
            }
             protected void btnSumbit_Click(object sender, EventArgs e)
            {
                mPresenter.btnSubmitClick();
            }
        }
    }
     
    The Presenter for the Article user interface
     
    using System.Web.UI.WebControls;
    using BLL.DTO;
    using System.Collections.Generic;
    namespace MVPDemoWeb.Views
    {
        public interface IArticleView :IView
        {
            int Idx { get; set; }
            List<DTOArticle> DtoArticles { get; set; }
            Label LblArticleId { get; set; }
            TextBox TbxTitle { get; set; }
            TextBox TbxBody { get; set; }
        }
    }
     
    The Presenter
     
    using System.Collections.Generic;
    using System.Linq;
    using MVPDemoWeb.Views;
    using BLL.DTO;
    using ServiceLayer.IServices;
     
    namespace MVPDemoWeb.Presenters
    {
        public class ArticleViewPresenter
        {
            private readonly IArticleView mView;
            private readonly IService1 mService;
             #region constructor
             public ArticleViewPresenter(IArticleView view, IService1
    theService)
            {
                mView = view;
                mService = theService;
            }
             #endregion
             #region Public Methods
             public void PageLoad()
            {
                if (!mView.IsPostback)
                {
                    mView.DtoArticles = mService.GetArticles();
                    var article = mService.GetArticle(5);
                    mView.Idx = 0;
                    PopulateFields(article);
                }
            }
             public void btnFirstClick()
            {
                mView.Idx = 0;
                PopulateFields(mView.DtoArticles, mView.Idx);
            }
             public void btnPrevClick()
            {
                if(mView.Idx == 0)
                {
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
                else
                {
                    mView.Idx -= 1;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
             public void btnNextClick()
            {
                if (mView.Idx == mView.DtoArticles.Count - 1)
                {
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
                else
                {
                    mView.Idx += 1;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
             public void btnLastClick()
            {
                mView.Idx = mView.DtoArticles.Count - 1;
                PopulateFields(mView.DtoArticles, mView.Idx);
            }
             public void btnUpdateClick()
            {
                var article = mView.DtoArticles[mView.Idx];
                 article.Tille = mView.TbxTitle.Text;
                article.Body = mView.TbxBody.Text;
                article.IsUpdate = true;
            }
             public void btnClearClick()
            {
                mView.TbxTitle.Text = "";
                mView.TbxBody.Text = "";
                mView.LblArticleId.Text = "Article not saved yet.";
            }
             public void btnSubmitClick()
            {
                var atleastonearticle = (from a in
    mView.DtoArticles.Where(a => a.IsUpdate
                                         || a.ArticleID == -1)
                                        select a).FirstOrDefault();
                 if (atleastonearticle != null)
                {
                    mView.DtoArticles =
    mService.SaveArticles(mView.DtoArticles);
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
             public void btnSaveNewClick()
            {
                if (mView.TbxBody.Text != ""
                    && mView.TbxTitle.Text != "")
                {
                    var article = new DTOArticle
                                     {
                                         ArticleID = -1,
                                         AuthorID = 1,
                                         Tille = mView.TbxTitle.Text,
                                         Body = mView.TbxBody.Text,
                                         IsUpdate = false
                                     };
                     mView.DtoArticles.Add(article);
                    mView.Idx = mView.DtoArticles.Count - 1;
                }
            }
             public void btnDeleteClick()
            {
                if (mView.DtoArticles.Count > 0)
                {
                    var article = mView.DtoArticles[mView.Idx];
                    mService.DeleteArticle(article);
                    mView.DtoArticles.RemoveAt(mView.Idx);
                    mView.Idx = 0;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
            #endregion
             #region Private Methods
             private void PopulateFields(DTOArticle article)
            {
                mView.LblArticleId.Text = article.ArticleID.ToString();
                mView.TbxTitle.Text = article.Tille;
                mView.TbxBody.Text = article.Body;
            }
             private void PopulateFields(List<DTOArticle> articles, int idx)
            {
                var article = articles[idx];
                 mView.LblArticleId.Text = article.ArticleID.ToString();
                mView.TbxTitle.Text = article.Tille;
                mView.TbxBody.Text = article.Body;
            }
             #endregion
        }
    }
       > *@Rune*
     > *Thanks for the hints. I'm not using any DTO objects between the Web ->
     > BLL -> DAL. They're all on the same server so are just referenced direct
     > project to project.*
     > *Any other advice greatly appreciated.*
     >
     
    The MVP being  shown here is event driven while the one I am using is
    not event driven, and the WEB controls are on the interface so they can
    be dealt with with by the presenter. I am using a session object that is
    controlled by the presenter too. The UI should be unaware of the BLL
    logic or the DAL thus the DTO(s).
     
    MODEL-VIEW-PRESENTER
     
     
    click 'Shows'
     
    click 'Design Patterns Bootcamp: Model View * Patterns*
     
    view parts  1-5
     
     
    Sunday, July 31, 2011 11:24 PM
  • Hi,

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance. 

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 5, 2011 8:33 AM
    Moderator