Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated for the new 5.3.2 change that allows instance variables to be any non-public scope.

...

Tapestry uses your class as a starting point. It transforms your class at runtime. This is necessary for a number of reasons, including to address how Tapestry pools shares pages between requests.

For the most part, these transformations are both sensible and invisible. In a few limited cases, they are marginally leaky – for instance, the requirement that scope restrictions on instance variables be private described below – but we feel that the programming model in general will support very high levels of developer productivity.

...

However, class reloading only applies to component classes and, starting in 5.2, Tapestry IOC-based service implementations (with some restrictions). Other classes, such as service interfaces, entity/model classes, or and other data objects, are loaded by the normal class loader and not subject to live class reloading.

...

Instance variables must be private. Tapestry must (In Tapestry 5.3.2 and later they can protected or package private as well – or even public, if marked final, or annotated with @Retain). These scope restrictions are necessary in order for Tapestry to perform runtime class modifications to support instance variables, and may only do so for private variables. You may have non-private variables instance variables with other scopes in your class, but you may then see unexpected behavior in a production application because of how Tapestry pools shares and reuses pages and components. Tapestry will log an error for each component class that contains fields that are neither static nor privateinstance variables that violate these scope restrictions.

Be aware that you will need to provide getter and setter methods to access your classes' instance variables. Tapestry does not do this automatically unless you provide the @Property annotation on the field.

...