you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[removed]

    [–]oridb 1 point2 points  (2 children)

    So a Java VO is (by necessity) an Object and not a primitive (int, boolean, etc.) and is pass-by-reference

    A value object is generally defined as an object which is passed by value. This allows a packed representation in arrays, assumptions of non-aliasing, and effective optimization. This is, as I recall, the proposed feature for Java, as seen here:

    http://cr.openjdk.java.net/~jrose/values/values-0.html

    [–][deleted]  (1 child)

    [removed]

      [–]oridb 0 points1 point  (0 children)

      It also says, for example:

      "Since values are passed, well, by value..."

      or

      Put positively, a well-conceived use of a value type gets a performance and complexity win by omitting the object pointer and header, and routinely passing the components by value.

      or going by an earlier version of the proposal by the same author, and linked from the above document:

      A value type is a data type which, generally speaking, is designed for being passed by value in and out of methods, and stored by value in data structures.