WCF/Data Service Generation/Change Bytes General questions

Thread is closed for posting
2 posts, 0 answers
  1. HaukiDog
    HaukiDog avatar
    2 posts
    Member since:
    May 2006

    Posted 23 Apr 2010 Link to this post

    I've been messing around with Open Access for a little while  and just have some general questions

    The first thing I did was watch the hour and a half video about disconnected api than I moved onto the DSW (which is what I probably started with)

    These are the following points I'd like to bring up that hopefully someone will have good suggestions for

    1) I like the changebytes concept because you're only transferring over WCF what changed plus you can probably just achieve all your WCF communications with a single service command for sending objects over the wire .... You just have to pass a type param as well so each side knows how to serialize/deserialize. Right?

    2) The isdirty used for monitoring if data should be transferred over doesn't check against original values it only validates if it's been set to anything... so if something gets changed back to its original value it will still register as dirty and that it needs to be sent over.. It seems like there should be a checksum or an object graph or something in the container (and even objectscope) for it to validate against to ensure that it is actually dirty?

    3) Because of how this works with changebytes I guess I could attach to the tracking object and monitor it myself and than in my own monitoring if I noticed an object hadn't changed than just remove it from the container when I get the Content to send over WCF?

    Moving on to the DSW
    4) It's nice having typed objects and methods though the changebytes concept seems to be a lot faster since you don't have to regenerate contracts if you add any fields..... But it seems like the persistence objects lack kind of the niceness of the dissconnected api methods with changedvalues and all that jazz.... You can't really attach the persistence objects to anything and have that monitor the changes than only push over objects that have changed. And the crud operations from the DSW are much more expensive

    Those are my first impressions curious anyones thoughts...
  2. Alexander
    Alexander avatar
    727 posts

    Posted 27 Apr 2010 Link to this post

    Hello Dave Nespoli,

    1. Actually you do not need to pass the type of the objects contained in a ChangeSet. The identity information for each object is serialized along with its changes so OpenAccess handles that automatically. The reason is that you could have multiple changes in objects with different types.

    2. You are right, once an object is modified, it is marked as dirty. The normal way of undoing changes is to rollback the transaction that contains those changes. Then the object should keep its original state. However, Transaction.Rollback() is not implemented yet for object containers but you can handle that manually using the GetContent() and Apply() methods. The code would look like this:
    ObjectContainer.ChangeSet set = container.GetContent();
    // do some changes
        container = new ObjectContainer();

    3. Yes, you can do that. Another approach would be to keep multiple 'old' change sets as shown above and use them as restore points.

    4. This is also correct. We are currently working on implementing natural attach/detach functionality which will allow to transmit persistent object directly over the service, avoiding the copying from/to transport objects. Hopefully this functionality will be available in the Q2 release this year.

    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