In this chapter you created the login system. Let's take a moment to review how you used Cairngorm to do this.
You were able to reuse the UserVO and UserNotificationVO value objects to pass data between classes and display notifications to the user.
You created LoginEvent and LogoutEvent classes that triggered the appropriate logic. The LoginEvent took in a UserVO object that was then passed to the command class. The Logout event simply triggered the corresponding command class.
You created a LoginDelegate with a login function that took in a UserVO and passed it to the FlexBlogDatabaseManager login function to simulate a service call. The login function of the FlexBlogDatabaseManager class returned a UserVO that was then passed back to the command class via the result responder method.
Since logout did not require accessing the database, no logout delegate class was required.
You created LoginCommand and LogoutCommand classes. The LoginCommand class took the UserVO passed in via the LoginEvent class and passed it to the login function of the LoginDelegate. The result function determined whether the UserVO passed back by the LoginDelegate was null (in other words, whether an account had been found). If an account was found, the currentUser property of the ModelLocator was updated with the UserVO object. If no account was found, the user was notified by means of a UserNotificationVO. The fault also makes use of the UserNotificationVO to notify the user that something ...