You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2013/05/26 22:01:20 UTC

[jira] [Created] (CAY-1831) CayenneRuntime.getContext - replace with newContext

Andrus Adamchik created CAY-1831:
------------------------------------

             Summary: CayenneRuntime.getContext - replace with newContext
                 Key: CAY-1831
                 URL: https://issues.apache.org/jira/browse/CAY-1831
             Project: Cayenne
          Issue Type: Task
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
            Priority: Minor
             Fix For: 3.2M1


Unlike other CayenneRuntime "getXyz" methods that return singletons (where "get" prefix is justified), "getContext" is creating a new context on every call. We need more apt naming, such as "newContext".

In fact I thought about this inconsistency initially when designing CayenneRuntime, but left it like that on assumption that CayenneRuntime will be managing its ObjectContexts scope. So in some situations it would return the same context multiple times. In practice managing OC scopes is always done outside Cayenne DI, and it should not normally try to interfere here. So this renaming will reduce confusion about the behavior of the method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira