/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. package flight.vo
  25. {
  26. /**
  27. * IValueObject is a common interface for many data structures, allowing
  28. * complex objects to be treated as simple types, as value versus reference.
  29. *
  30. * <p>A value object is an object that can be compared by the values of its
  31. * properties rather than its identiy. Two value objects may be equal
  32. * because their data is identical, even if they are individual reference
  33. * objects in ActionScript. Through implementing equals() two value objects
  34. * can be compared by their data, while clone() allows value objects to be
  35. * passed by value (as copies).</p>
  36. *
  37. * @see #equals
  38. * @see #clone
  39. */
  40. public interface IValueObject
  41. {
  42. /**
  43. * Evaluates the equality of another object of the same type, based on
  44. * its properties.
  45. *
  46. * @param value The target of the comparison.
  47. */
  48. function equals(value:Object):Boolean;
  49. /**
  50. * Returns a new object that is an exact copy of this object.
  51. *
  52. * @return The replicated object.
  53. */
  54. function clone():Object;
  55. }
  56. }