Spring UI Scope
The add-on has defined custom Spring scope: UI.
Please analyze sample application 'Simple Bank' to see how scope UI is used to create Spring powered Vaadin application in Model-View-Presenter architecture
Keep the following rules:
- Model (pojo) usually is singleton Spring bean
- Presenter (pojo) is UI-scope proxy Spring bean
- View (Vaadin component) is UI-scope Spring bean
Restrictions are cause by circular dependency between View and Presenter. Spring allows that only if one party is a proxy. If View is a proxy, Vaadin framework fails. Possible reason is that the framework use protected or package methods, which are not handled by proxy; only public methods are handled. Therefore, View must be UI-scope normal class and Presenter must be UI-scope proxy bean.