O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

16.1. Login and Logout Overview

The login and logout feature has the following requirements:

  • The login interface should be accessible from any view in the application.

  • Login is accomplished using the user name and password supplied at the time of registration.

  • If login is successful the login form must be cleared.

  • A welcome message containing the user's first name should be displayed to replace the login form.

  • All the current user's account information should become available to the application. The login service will return this data if an account is found.

  • If login is not successful, the user should be notified and told to check the user name and password and try again.

  • Logout consists of clearing the data for the current user and returning to the main posts view.

To make the login form accessible from anywhere in the application, you will add it to the ApplicationControlBar. The login form will be a simple form that collects the user name and password and has a submit button.

To clear the form you will use the same methodology that you used for the registration form: by binding a setter function to a property on the ModelLocator indicating the success of the login process. The same variable on the ModelLocator will determine whether a welcome message should be displayed and whether to redisplay the form when the user logs out.

The displaying of messages related to the login process will be handled in the login command class. This will be done by updating the userNotification property ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required