Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4761

MVVM provides an option to disable viewmodel annotation caches

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 9.5.0.2
    • Fix Version/s: 9.6.0
    • Component/s: Databind 2
    • Security Level: Jimmy

      Description

      Steps to Reproduce

      change a view model command name annotation

      	@Command("test")
              public void doTest() {}
      

      update to

      	@Command("test2")
              public void doTest() {}
      

      perform hot code reloading in debug mode (e.g. using DCEVM or jrebel)

      Current Result

      the updated command name is not found, even though the class has successfully reloaded using the respective development tools

      Expected Result

      in order to improve the development experience
      provide a flag to disable method caching in BinderImpl (for development purposes)

      • _initMethodCache
      • _destroyMethodCache
      • _commandMethodCache
      • _globalCommandMethodCache

      or provide flags to configure cache sizes/lifetimes (allowing to set sizes to 0 in development scenarios)

      also make configurable

      • org.zkoss.bind.BindComposer#_afterComposeMethodCache
      • org.zkoss.bind.BindComposer#_historyPopStateMethodCache

      Debug Information

      an existing cache with configuration property
      https://github.com/zkoss/zk/blob/v9.5.0.2/zel/src/org/zkoss/zel/BeanELResolver.java#L43-L61

      consider using LibraryProperty for ZK specific config

      Workaround

      • use @Command without specifying a command-name, and change the method name instead
      • clear the various caches programmatically via reflection (e.g. automatically in DesktopInit or ExecutionInit)
        example listener code based on ZK 9.5.0.2 AutoClearCaches.java

        Attachments

          Activity

            People

            Assignee:
            DevChu DevChu
            Reporter:
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: