This is a migrated thread and some comments may be shown as answers.

ObjectScopeProvider vs ObjectContainerProvider

2 Answers 119 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Teguh
Top achievements
Rank 1
Teguh asked on 22 Jul 2010, 07:59 AM
Hi,

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,
Teguh

2 Answers, 1 is accepted

Sort by
0
Petko_I
Telerik team
answered on 23 Jul 2010, 07:54 PM
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,
Petko_I
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
0
Teguh
Top achievements
Rank 1
answered on 27 Jul 2010, 06:43 AM
Hi Petko_l,

Thank you for the detailed explanation :)

Regards,
Teguh
Tags
Getting Started
Asked by
Teguh
Top achievements
Rank 1
Answers by
Petko_I
Telerik team
Teguh
Top achievements
Rank 1
Share this question
or