Re: DataContextFactory

From: Mike Kienenberger (mkienen..mail.com)
Date: Thu Sep 15 2005 - 17:39:36 EDT

  • Next message: jira-norepl..bjectstyle.org: "[OS-JIRA] Created: (CAY-377) Better logging for delete cascading"

    It's easier to ignore the passed ObjectStore than it is to create one
    out of thin air :)

    We need to support the most common use case (subclassing DataContext
    and making some minor change to it) and that requires that we can call
    the same method that would have been called before. Ie,

            if (null == dataContextFactory) {
                context = new DataContext(this, new ObjectStore(snapshotCache));
            }
            else {
                    context = dataContextFactory.createDataContext(this, new
    ObjectStore(snapshotCache));
            }

    If you want a custom ObjectStore, maybe we need an ObjectStoreFactory too :)

    -Mike

    On 9/15/05, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > But what if you'd want a custom ObjectStore? I think this might be a
    > quite common need, as this would allow cache tweaking. So how about
    > this then:
    >
    > DataContext createDataContext(DataDomain parent);
    >
    > Andrus
    >
    >
    > On Sep 15, 2005, at 5:25 PM, Mike Kienenberger wrote:
    >
    > > Changing the method signature to the following, since it's the minimum
    > > needed if we did want to create a DefaultDataContextFactory or do a
    > > trivial subclass of DataContext.
    > >
    > > public interface DataContextFactory {
    > > DataContext createDataContext(QueryEngine parent, ObjectStore
    > > objectStore);
    > > }
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Sep 15 2005 - 17:39:37 EDT