To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.
What is the best practice to develop a Vaadin application ?
ie , whether to define the layout, components , event handling,component validation etc in the main application class itself (in init method) or define seperate classes for each and instantiate it when ever necessary ?
In trivially simple applications you might do everything in the application class, but for almost any real application you should modularize the application better. Composition, usually with CustomComponent, and inheritance are the basic techniques.
The application class of a non-tiny application does normally the following tasks:
Initialize database connection (often shared between sessions)
Initialize business data (often shared between sessions)
Manage internationalization (current locale and resource bundles)
Handle cookies and such
Launch the user interface (typically through a view manager)