21.2. How Value Objects Have Been Used

Value objects were used in a number of ways in the sample application.

The first major use was for simplifying the transfer of related collections of data between classes and the backend (aka data transfer objects). By mirroring how data is stored on the backend in the properties of value objects, we made it simpler to pass data back and forth to the server (or in our case the local database). It's simpler because you know how the data is being represented on both ends. The event, command, and delegate classes, as well as the FlexBlogDatabaseManager acting as the service simulator, all made use of value objects to pass data between classes and update the ModelLocator.

Other common uses occurred in the views. Value objects were used to display the properties of a given value object through data binding. They were also used by various selection components such as lists to allow the user to select a value object that would then be passed to an event or update the model to change views.

Get Professional Cairngorm™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.