ObjectScopeProvider vs ObjectContainerProvider

Thread is closed for posting
3 posts, 0 answers
  1. Teguh
    Teguh avatar
    12 posts
    Member since:
    Aug 2008

    Posted 22 Jul 2010 Link to this post


    I am very new to the OpenAccess.
    And I would like to ask what is exactly the difference between ObjectScopeProvider and ObjectContainerProvider?
    Sample of the usage of both provider would be really great :)
    I'd like to know so that I can determine which one is the most suitable on my project.

    Thank you,
  2. Petko_I
    Petko_I avatar
    184 posts

    Posted 23 Jul 2010 Link to this post

    Hello Teguh,

    The ObjectScopeProvider and the ObjectContainerProvider are actually factories for getting instances of the IObjectScope and ObjectContainer containers respectively. These containers have been designed for slightly different purposes, although they implement the same interface IObjectContext.

    ObjectScopeProvider’s purpose is to provide the means for obtaining a database context – an IObjetScope.  The IObjectScope lets you access the persistent types mapped to the tables in your database. It thus provides the connection between the object-oriented model and the relational model. It offers tools for adding, updating and deleting persistent objects and exposes transaction management. This covers more or less the basic functionality of the scope.

    You should note that we are currently putting our efforts in the OpenAccessContext which comes with the visual designer. In general, the OpenAccessContext and IObjectScope can accomplish the same things. Some of the advantages of the OpenAccessContext are simpler access to persistent objects and simpler logic for transaction management. In fact, transaction management is not something the user should worry about with the new context. Bear in mind that you cannot mix the OpenAccess classic wizards with the Visual Designer. You choose either of the two approaches and build your solution based on the chosen approach.

    The ObjectContainer’s purpose is nicely introduced under the following section of our chm help that comes with the installation of Telerik OpenAccess: OpenAccess ORM Classic >Programming With OpenAccess >The OpenAccess ORM Disconnected API. The help section provides some simple examples to get you started. Also, you may find of particular interest the disconnected scenario blog posts:

    Using the ObjectContainer in Disconnected Scenarios

    Using the ObjectContainer in Disconnected Scenarios Part 2

    In short, the ObjectContainer is used for disconnected web scenarios as all the objects in it along with the container can be serialized. The disconnected API doesn’t currently have an equivalent in the new Visual Designer.

    In order to get the feel of the domain model usage workflow, I suggest you browse the Getting Started > Quickstart section and identify the scenario closest to your needs. There you will find the basics of the domain model handling.

    Should you have any further questions, do not hesitate to contact us back.

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Teguh
    Teguh avatar
    12 posts
    Member since:
    Aug 2008

    Posted 27 Jul 2010 Link to this post

    Hi Petko_l,

    Thank you for the detailed explanation :)

Back to Top