Re: ObjectContext & Factory

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Aug 16 2007 - 17:21:24 EDT

  • Next message: Gilberto C Andrade: "Re: [POLL]: Cayenne 3.0 -- Java 1.4 or 5 support?"

    More to the point ... The two ways to instantiate DataContext
    provided by Cayenne framework that are using DataContextFactory
    behind the scenes (DataContext.createDataContext() and
    WebApplicationContextFilter) may need to be migrated to something
    that returns ObjectContext instead. But keep in mind that those are
    just utilities and you don't have to use them (and
    DataContextFactory). You can create your own context in your code,
    skipping the factory.

    Andrus

    On Aug 16, 2007, at 9:13 AM, Andrus Adamchik wrote:
    >>>
    >>> On 16/08/2007, at 9:02 PM, Adrian Wiesmann wrote:
    >>>
    >>>> Could anybody please help me out with an example of how to use
    >>>> ObjectContextFactory, ObjectContext and ObjectContextDecorator?
    >>>> I would
    >>>> like to write some code which makes sure that every
    >>>> ObjectContext created
    >>>> in my application is created by my own factory which
    >>>> automatically adds a
    >>>> decorator (and idirectly lifecycle callbacks). I am mostly
    >>>> interested to
    >>>> see how my own factory could first call the "base"
    >>>> implementation (not
    >>>> sure what and where the "base" is). I got it working with
    >>>> DataContextFactory but ObjectContext seems to be a little bit
    >>>> different to
    >>>> that.



    This archive was generated by hypermail 2.0.0 : Thu Aug 16 2007 - 17:21:57 EDT