PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/flight/vo/IValueObject.as

https://code.google.com/
ActionScript | 58 lines | 8 code | 2 blank | 48 comment | 0 complexity | 530cb777afc42b36370cfd81b9247ccc MD5 | raw file
 1////////////////////////////////////////////////////////////////////////////////
 2//
 3// Copyright (c) 2009 Tyler Wright, Robert Taylor, Jacob Wright
 4// 
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to deal
 7// in the Software without restriction, including without limitation the rights
 8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11// 
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14// 
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22//
23////////////////////////////////////////////////////////////////////////////////
24
25package flight.vo
26{
27	/**
28	 * IValueObject is a common interface for many data structures, allowing
29	 * complex objects to be treated as simple types, as value versus reference.
30	 * 
31	 * <p>A value object is an object that can be compared by the values of its
32	 * properties rather than its identiy. Two value objects may be equal
33	 * because their data is identical, even if they are individual reference
34	 * objects in ActionScript. Through implementing equals() two value objects
35	 * can be compared by their data, while clone() allows value objects to be
36	 * passed by value (as copies).</p>
37	 * 
38	 * @see		#equals
39	 * @see		#clone
40	 */
41	public interface IValueObject
42	{
43		/**
44		 * Evaluates the equality of another object of the same type, based on
45		 * its properties.
46		 * 
47		 * @param	value			The target of the comparison.
48		 */
49		function equals(value:Object):Boolean;
50		
51		/**
52		 * Returns a new object that is an exact copy of this object.
53		 * 
54		 * @return					The replicated object.
55		 */
56		function clone():Object;
57	}
58}