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

9.3. How Do You Create One?

Again, you will see varying locations for creating value objects, and you will also see varying names for the package that contains the value object classes. "Flex 3: Introducing Cairngorm" (cited in earlier chapters) creates in the valueObjects package, as shown in (Figure 9-1).

Figure 9.1. Figure 9-1

The Cairngorm store creates them in a vo package, as shown in (Figure 9-2).

Figure 9.2. Figure 9-2

The general naming convention is to prefix the letters VO with the name of the object represented.

Since implementing the IValueObject interface is optional, creating a value object is basically the same as creating any other class in Flex. After you have created the class, you simply add the public properties to it. If you are using the value object as a data transfer object, you need to make sure that these properties match the remote object to which they correspond.

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