[ 
https://issues.apache.org/jira/browse/WICKET-857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520618
 ] 

Roy van Rijn commented on WICKET-857:
-------------------------------------

Isn't it common practice to make all objects that got inserted (dependency 
injection, Spring) transient so they don't get serialized? You have to keep the 
Model serialized but all the helper-fields should be serialized. The serialized 
part has to be as small as possible..

> Method of forcing the use of transient
> --------------------------------------
>
>                 Key: WICKET-857
>                 URL: https://issues.apache.org/jira/browse/WICKET-857
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>            Reporter: Roy van Rijn
>             Fix For: 1.4.0-alpha
>
>         Attachments: added_tester_code
>
>
> A common problem in Wicket is that people forget to put everything in the 
> WebPage objects on 'transient'. This will cause memory-problems. In our 
> current project I added a little bit of code to a testclass that extends the 
> WicketTester that takes care of this problem.
> It works like this:
> When a page is loaded with the WicketTester is checks all the field the Page 
> had. If the field implements the IModel interface its ok. If the field has 
> transient its also fine. But if there are fields that have neither it will 
> fail the test. This way programmers are forced to make the field transient.
> Because sometimes fields need to be serialized without being IModels I also 
> added a @SkipSerializableCheck annotation.
> This forces programmers using Wicket to think about serialization and they 
> have to add a annotation to make is serializable instead of adding transient 
> to make it non-serializable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to