Vaadin 7 alpha2 contains significant changes in how communication between the server and the client connector is done. Communication is now based on RPC calls (server ↔ client) and shared state (server → client). The old UIDL and variable based API is provided only to ease migration of Vaadin 6 components.
Shared State
Each component in Vaadin 7 has a shared state. The shared state is a standard Java bean that is automatically synchronized from the server to the client. You set the values on the server side and can read them on the client side without any additional code. This provides type safety and an easier programming model compared to the earlier paint mechanism in Vaadin 6.
All the Java types you use in the shared state must be available to the GWT compiler so you need to create them in the client side Java package. You can use standard Java types and custom beans in your shared state. You can have collections of custom beans in multiple levels. Do however note that polymorphism is not supported, the declared type is always used.
Remote Procedure Calls
Remote Producedure Calls can be made from the client to the server or from the server to the client. By defining an RPC interface you can get a generated proxy implementation on the calling side, which will automatically take care of that the method is called on the other side. Of course you need to implement the interface on the other side so there is some code to be executed.
The same restrictions as for shared state apply.
Special Vaadin Type
There are some special Vaadin types (Component, Resource) that need special handling when used in RPC methods or in the shared state. See the “Using Resources and Components in the shared state” tutorial for more information (
https://vaadin.com/wiki/-/wiki/Main/Vaadin+7
).
Noteworthy
The communication in alpha2 has not been optimized. There is a lot of data sent between the server and the client. We will focus on optimizing the communications before 7.0 by sending only differences in state, shortening fully qualified class names etc.
There are some restrictions as what types work with shared state and RPC. Avoid typed arrays and enums at the moment; we should get the support there before the final version.
RPC methods currently need to have unique names (no overloading allowed)
You should not declare state classes as static inner classes in you connector class. Some class loaders have problem using them on the server side without trying the load the connector class, which fails as it references GWT classes (directly or indirectly).
For short examples on how to use the new features, check out the Vaadin 7 mini tutorials:
https://vaadin.com/wiki/-/wiki/Main/Vaadin+7
For information on how to migrate from Vaadin 6 to Vaadin 7, see
http://dev.vaadin.com/wiki/Vaadin7/MigrationGuide
This is an alpha release so we expect there to be bugs and still expect changes will be made to the API and functionality before the final 7.0.0 release. All your comments on the new features are welcome. Please post all Vaadin 7 related comments in the Vaadin 7 category of the forum.