Thread Bound DataContexts - Bad Pattern?

From: Joel Trunick (joel.trunic..ebifysolutions.com)
Date: Mon Dec 05 2005 - 12:04:54 EST

  • Next message: Joshua Pyle: "Re: Thread Bound DataContexts - Bad Pattern?"

    I've been putting static methods on my domain objects to perform things
    like queries (for that object), and even simple methods load an instance
    by ID (returning an instance of the proper type). I find this
    organization very straightforward to use from a client perspective.

    However, to do this I rely on the DataContext bound to the thread a lot,
    and I'm wondering if this is architecturally flawed.

    I've already recognized that some (not all) of the queries belong on the
    client-side (tapestry pages), according to the DDD book, so I'm looking
    at getting rid of all these thread dependent methods.

    The question is then:
    1) When do you ever need multiple datacontexts? (right now from web app)
    2) Is the thread bound context a limitation?

    J



    This archive was generated by hypermail 2.0.0 : Mon Dec 05 2005 - 12:05:01 EST