Book Image

Vaadin 7 Cookbook

Book Image

Vaadin 7 Cookbook

Overview of this book

Table of Contents (19 chapters)
Vaadin 7 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The Login form with Model View Presenter


In this recipe, we will implement a login form using the Model View Presenter (MP) pattern.

We want to introduce a Vaadin application applying the MVP pattern in this recipe and therefore the login form will be of low complexity. The login form will consist of two text fields and a login button. When a user clicks on the login button, the request is forwarded to the presenter. The presenter calls the service in order to fetch a user from the database. Then the presenter notifies the user interface about the success or the failure.

Note

Basic information about Model View Presenter pattern can be found on Wikipedia at http://en.wikipedia.org/wiki/Model-view-presenter.

More detailed description of MVP pattern is available at http://martinfowler.com/eaaDev/ModelViewPresenter.html.

Getting ready

Before we start, we create a simple class diagram. Start reading the class diagram from the MyVaadinUI class. MyVaadinUI creates all the three MVP layers; view, presenter...