Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1228

Reorganizing/splitting out DomainObjectContainer service.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: core-1.8.0
    • Fix Version/s: 1.12.0
    • Component/s: Core
    • Labels:
      None

      Description

      Originally this ticket was much narrower in scope, simply to introduce nextTransaction() into fixture scripts.

      This was implemented by adding nextTransaction() to DomainObjectContainer.

      From there though I decided that DOC was become too bloated, so split it out into a number of other domain services:

      • TransactionService ... for this new method and also flushTransaction

      but then eventually also:

      • RepositoryService (persist, allMatches, uniqueMatch, firstMatch)
      • MessageService (informUser, warnUser, raiseError)
      • ConfigurationService (getProperties etc)
      • ServiceRegistry (lookupService, injectServicesInto)

      The existing DOC methods have been deprecated, the DOCDefault impl delegates to the new services.

      ~~~~
      The original request for this ticket was raised by Oscar:
      When using FixtureScripts, there can be many actions that, on the real world, are execute in different time contexts.

      For example, a user creates an Account on the webapp and after that executes different actions.

      That’s relevant if using the queryResultsCache service (or the new planned “@Action” annotation extension) because the results previously created (i.e., the Account) might be available on the cache.

      So perhaps some mechanism like the nextTransation() method might be also introduced on FixtureScripts.

      What do you think?

      ~~~~~~~
      Dan's reply:
      Makes sense.

      There is a nextTransaction() method in the AbstractIntegTest class, you could see how that is implemented and see if it can be adapted?

      Or, another idea is that the framework could run each FixtureScript automatically in a separate transaction; that would be a better simulation of a sequence of user interactions?

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit fcfe52218c003a32023d84577f948af958ffdf34 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=fcfe522 ]

        ISIS-1228: splitting out a TitleService

        Show
        jira-bot ASF subversion and git services added a comment - Commit fcfe52218c003a32023d84577f948af958ffdf34 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=fcfe522 ] ISIS-1228 : splitting out a TitleService
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 56ccc9c354d86773f8dcb3df03de2ada6d3e48b3 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=56ccc9c ]

        ISIS-1228: add RepositoryService#instantiate(...) as a convenience method.

        Also refactor the simpleapp to use the new services.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 56ccc9c354d86773f8dcb3df03de2ada6d3e48b3 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=56ccc9c ] ISIS-1228 : add RepositoryService#instantiate(...) as a convenience method. Also refactor the simpleapp to use the new services.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit cbdc90b66874ef20fb18f2e149b0460052284df2 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=cbdc90b ]

        ISIS-1228: further edits for the Domain Service docs

        Show
        jira-bot ASF subversion and git services added a comment - Commit cbdc90b66874ef20fb18f2e149b0460052284df2 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=cbdc90b ] ISIS-1228 : further edits for the Domain Service docs
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit c21c22c730b9d70f332cec19021f0bfa7039e094 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=c21c22c ]

        ISIS-1228: updating docs.

        Show
        jira-bot ASF subversion and git services added a comment - Commit c21c22c730b9d70f332cec19021f0bfa7039e094 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=c21c22c ] ISIS-1228 : updating docs.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 387fe368f0eb909334280e8bab657e255daf764f in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=387fe36 ]

        ISIS-1228: breaking out new domain services from DomainObjectContainer.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 387fe368f0eb909334280e8bab657e255daf764f in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=387fe36 ] ISIS-1228 : breaking out new domain services from DomainObjectContainer.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 91d25c45f033efcb388d26f22391680e16499235 in isis's branch refs/heads/ISIS-1228 from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=91d25c4 ]

        ISIS-1228: breaking out new domain services from DomainObjectContainer.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 91d25c45f033efcb388d26f22391680e16499235 in isis's branch refs/heads/ ISIS-1228 from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=91d25c4 ] ISIS-1228 : breaking out new domain services from DomainObjectContainer.
        Hide
        danhaywood Dan Haywood added a comment -

        The nextTransaction() in IntegrationTestAbstract uses IsisSystemForTest.get() - a threadlocal - to reach into the framework and get hold of the IsisTransactionManager for the current PersistenceSession.

        This isn't exposed as a domain service that could be injected into a FixtureScript.

        So I think this ticket really should be to provide that functionality. the IntegrationTestAbstract (and associated ScenarioExecutionForIntegrationTest) could then be simplified/refactored.

        Show
        danhaywood Dan Haywood added a comment - The nextTransaction() in IntegrationTestAbstract uses IsisSystemForTest.get() - a threadlocal - to reach into the framework and get hold of the IsisTransactionManager for the current PersistenceSession. This isn't exposed as a domain service that could be injected into a FixtureScript. So I think this ticket really should be to provide that functionality. the IntegrationTestAbstract (and associated ScenarioExecutionForIntegrationTest) could then be simplified/refactored.

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            danhaywood Dan Haywood
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development