Open topic with navigation
You are here: Client-Server > Anonymous Classes In Client Server Mode
Anonymous Classes In Client Server Mode
Anonymous classes are used to implement Native Query
predicates, Comparators and Evaluations. In this case it is important to
remember that in client/server mode they will be marshaled and sent together with the graph of
referenced objects to the server. The catch here is that anonymous classes
contain a reference to their parent class, meaning that the parent class will
be marshalled as well!
This has two issues:
- All the stuff referenced by the parent class will be marshaled and sent too. This means additional traffic between the server and the client.
- The parent class maybe contains stuff which cannot be serialized.
- You can only use anonymous classes when the client and the server have all classes available refered by the anonymous class. This means in fact that the server should have the same classes available as the client.
Note that when a native query can be optimized, the anonymous class isn't used, but rather SODA. In such cases this issues don't apply.