I don’t understand what is structurally different between a Value Object and a Class in ActionScript3.
Can any Class be a VO if you decide to call it one?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An actionscript class can include fields (vars), properties (getters/setters) and methods. The term value object refers to classes used by frameworks (such as Cairngorm) to store and pass data among components and modules. These classes act as templates to hold data and generally won’t contain functions other than getters/setters.
The Cairngorm framework has a IValueObject interface that doesn’t include any methods.
Value object is a loose term in actionscript. The AS3 language reference here has used this term for an object that’s passed to the constructor of a class to initialize its properties.
The use of value object enable the users of the class to initialize only those properties that they wish to. An alternative to this method (more robust and less error prone one imo) is to specify each property as arguments to the constructor and assign default values to them.