Re: Cayenne 1.2 + PostgreSQL

From: Kevin Menard (kmenar..ervprise.com)
Date: Fri Dec 09 2005 - 14:19:18 EST

  • Next message: Cris Daniluk: "Re: Cayenne 1.2 + PostgreSQL"

    On 10/14/05 9:57 PM, "Andrus Adamchik" <andru..bjectstyle.org> wrote:

    > I think you don't need to access DataNode from DbAdapter.
    > "org.objectstyle.cayenne.dba.PkGenerator" is already an attribute of
    > DbAdapter.
    >
    > On a side note, it was bad decision made back in the day when we
    > chose to reuse the runtime Cayenne access stack objects for Swing
    > model. It was supposed to save time, instead it created a bit of a
    > mess in the Modeler.

    Well, it's been a little while, but I'm digging my heels back in for this
    one. Given that there's a lot about the internals that I still don't quite
    get, I'm just going to think out loud a bit here and ramble off some
    observations I've made. If I'm off base, please chime in.

    DbAdapter does indeed have a way to retrieve a PkGenerator, but there is no
    corresponding set method.

    JdbcAdapter does have a setter for the PkGenerator and while I believe every
    adapter extends from it, I can't use it when programming with the DbAdapter
    interface.

    What it seems would be necessary is to either pull up the setter method,
    which means an API change people will need to be aware of. The effect
    within Cayenne will be minimal since JdbcAdapter already has an
    implementation. Alternatively, the db adapters could pull their PkGenerator
    out of the DataNode themselves, but then would require a reference to said
    node.

    With dependency injection being the new guy in town, it would seem the first
    option would be the best. So, would pulling that setter method up to the
    interface level be welcomed? If so, I can just do it here and include it in
    my changeset. Otherwise, I'm open to other suggestions.

    -- 
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Fri Dec 09 2005 - 14:19:24 EST