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

MVVM provides an option to disable viewmodel annotation caches


    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 9.6.0
    • Databind 2
    • Security Level: Jimmy

      Steps to Reproduce

      change a view model command name annotation

              public void doTest() {}

      update to

              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

      consider using LibraryProperty for ZK specific config


      • 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 AutoClearCaches.java

            DevChu DevChu
            cor3000 cor3000
            0 Vote for this issue
            3 Start watching this issue