The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Syncing objects that share columns

Last post 07-27-2007, 12:59 AM by pritcham. 3 replies.
Sort Posts: Previous Next
  •  07-26-2007, 10:03 AM 4115

    Syncing objects that share columns

    I have two objects:  ES1 is a collection and ES2 is a single entity

    ES1 is a view that joins two tables [Apps] and [Loans] and returns only a few columns but many records that meet a criteria

    ES2 is a record from a table [Apps]

    ES1 is used to display a grid of items that need to be updated. ES2 is the object I use to update the data.

    When I update the data using ES2, how can I tell ES1 to reload the current entity only so that the changes are reflected in the grid. I don't want to hit the database for all the records again if I can avoid it.

     

  •  07-26-2007, 1:43 PM 4122 in reply to 4115

    Re: Syncing objects that share columns

    Once ES2 is updated, rather than reloading the current entity only into ES1, why not just set the matching fields in ES1's current entity from ES2?
    David Neal Parsons
    www.entityspaces.net
  •  07-26-2007, 3:00 PM 4123 in reply to 4122

    Re: Syncing objects that share columns

    Thats what I'm doing currently. The thing is I will have variations of the list entity based on other joins and I was hoping for a way to do the update generically.

    Since I may have several views (say.. ES1a, ES1b, Es1c...) all based on joining [Apps] with some other tables, I think I will extend the custom classes to update themselves by implementing an UpdateFromApps(apps) method or something similar. That way each one will only update the fields it needs. If I can figure out the reflection in a timely manner I may just do a helper function and be done with it.

    If anyone has other ideas please share. 

  •  07-27-2007, 12:59 AM 4133 in reply to 4123

    Re: Syncing objects that share columns

    Hi

    Have you looked at implementing a cache of any description? I know you're working on a Winforms app but you can still use a cache there if appropriate - especially if you can introduce some server notification to inform your app(s) when changes in the database occur.

     Cheers

    Martin

View as RSS news feed in XML