Disconnected API, large graph, partial download in ObjectContainer

4 posts, 0 answers
  1. -=VIRT=-
    -=VIRT=- avatar
    4 posts
    Member since:
    Jun 2005

    Posted 23 Jul 2010 Link to this post

    I am doing experiments with Disconnected API. In my case, there are huge business objects, in which complex relationships, such as an employee has 47 fields, collection of contacts, a collection of photos, a collection of stories addresses every element of the history of appeals, also contains a subordinate on a one-to-many objects, etc. .

    As a result a large graph of business objects, which must be loaded into my N tier application, in parts, but parts may be edited, added and deleted on the client, after which the count should go back to the database.

    Actually the main question:

    I've downloaded to the client application object "Employee" and put it in ObjectContainer, user edit data object "Employee" and wanted to have to download multiple objects "Contact" for editing, which are in the "one person -> many contacts. " Download 2 contact to ObjectContainer client application and use them there using the method of Apply() I was surprised by the following picture: The container has 3 object (one Employee and two Contact), but the collection of "Contacts" object "employee" - empty!

    Why?, There is in fact the primary and secondary identifiers match ... ??
    What you recommend? How to load on demand subordinate objects in the graph and apply to ObjectContainer, that these loadable objects were available through the Persistent Class?
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 23 Jul 2010 Link to this post

    Hi -=VIRT=-,
    You can add the Employee to the container and use a callback mechanism to add the contacts that are touched from the code using the container. Just add an event handler to

    container.ResolveProxy += <tab><tab>

    Now you have a way to add object lazily to the container.

    All the best,
    Jan Blessenohl
    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. DevCraft banner
  4. -=VIRT=-
    -=VIRT=- avatar
    4 posts
    Member since:
    Jun 2005

    Posted 23 Jul 2010 Link to this post

    Hi Jan,
     

    We used N tier architecture, ie ORM system does not have direct access to the service! In other words, to even make a request to the server via the Internet must use a specially designed transport mechanism, ie to form a request packet then call on the server too few intermediate levels ...

    Do you have the documentation there is mention of support for N tier architecture, but simple examples of WCF services. It is unclear yet how to load a graph of objects partially ...

    You propose to subordinate objects are loaded as needed, in obtaining access to accessory GET properties collections. In our case, this is unacceptable! Only the software to decide when he makes a request to the server, and in your proposal that will decide the ORM system.

    These difficulties are compounded by the fact that many of our potential customers have no fast line Internet, in the normal case, this line of 128 KBit / sec. Our server is installed in the fast line internet data center in Moscow. Therefore, any request from the program to our server is provided with indication of progress, in which the calculation of the time, as in transport we have laid a strong support for fault tolerance in case the connection breaks and other failures. Based on all of the above conclusion follows that the program can do various unfounded requests to the server. Queries are made only when there is an urgent need.

    You could give an example in which the application loads the data from the server and adds them to the container if necessary, but not when trying to access the property???

    Thank you for your prompt reply.

  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 26 Jul 2010 Link to this post

    Hi -=VIRT=-,
    My suggestions are not something you have to follow 100%, I am just sharing ideas that I saw in customer applications and ideas that we had when we designed the API.
    If it is not possible to have too many C/S calls it is the far better approach to fill the container with all necessary data you need for a certain use case.
    I see several ways for the data transport, ObjectContainer is one, serializing data trees is another, and using one of our code generators for Ria or WCF is the third. If you are fine with proprietary web service definitions the container way is a good one because you do not have to care about the change tracking. Nevertheless you have to fill the container with the data you need otherwise you will see 'not loaded' exceptions on your client side. The event is just a last chance to get the data into the container.

    To fill the container you can use our predefined mechanisms by using FetchGroups and the FetchGroupsCollector. Is that not enough for you? Do you want it more flexible?

    Sincerely yours,
    Jan Blessenohl
    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
Back to Top