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

19.8. Summary

In this chapter you created the login system. Let's take a moment to review how you used Cairngorm to do it.

You created a new value object class named CommentVO to represent comments and used the existing PostVO. The CommentVO class is used for adding comments and for displaying comments in the CommentList via the CommentDisplay itemRenderer. The existing PostVO class was used to load comments for the currently selected post by using the postId property of the currentPost property of the ModelLocator.

You created LoadCommentsEvent and AddCommentEvent event classes. The LoadCommentsEvent took in a PostVO (in this case the one referenced by the the currentPost property of the ModelLocator) that was passed to the LoadCommentsCommand class so that the postId property could be used to retrieve comments associated with that post. The AddCommentEvent took in a CommentVO that was passed to the AddCommentCommand class so that the data could be passed to the command class and added to the database.

You created LoadCommentsDelegate and AddCommentDelegate delegate classes. The loadComments function of the LoadCommentsDelegate class took in PostVO as a parameter. It then called the getComments function of the FlexBlogDatabaseManager, passing it the PostVO, which returned an array of PostVO objects. This array of PostVO objects was passed back to the LoadCommentsCommand class on the post property of the result object of the ResultEvent. The addComment function of the AddCommentDelegate ...

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