IObjectScope best practice usage

2 posts, 0 answers
  1. Andrea
    Andrea avatar
    64 posts
    Member since:
    Jan 2005

    Posted 20 Feb 2009 Link to this post

    Hi,

    I would understand the best practice usage of the IObjectScope instance from .GetNewObjectScope

    If, in a windows form, I need to call the DB in many places (to load a list, to load an object through its ID, to delete it, etc... ) what approach I must follow:
    1. one IObjectScope instance at class level
    2. a new IObjectScope instance every time that I need data from DB or I need to put data to the DB

    Regards
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 20 Feb 2009 Link to this post

    Hello Andrea,

    The more preferable way of handling the object scope is the first that you have mentioned in your previous post. An object scope should be created at class level (WindowsForm) and disposed in the Dispose() method of the form. You can use the ObjectView BindingSource as well. It will handle the task automatically.


    All the best,
    Zoran
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
Back to Top