best practice

Hi All,

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 ?


Niyas

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:

[list]

[]
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)

[/list]Check out
one example
.

Hi Marko,

Thanks for the info.


Regards,
Niyas