<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <font size="4"><font face="monospace">We may be circling around the
        terminology block, but let's try on not calling an int or a
        Point "a value" without some sort of modifier.  <br>
        <br>
        Let's try "value object" rather than just "value"; a variable of
        type int or Point.val holds a value object, and Point.ref holds
        a *reference to a* value object.  Object holds references to
        either value or identity objects.  Primitives are revealed to be
        value objects.  Everything is an object.<br>
        <br>
        (Alternately, we could lean on more placement-centric
        terminology.  Point.val and int are _direct values_ (or
        immediate values).  But what do we say about references then? 
        References are references to objects.  This one feels like it
        recedes more into the mental models we don't want to encourage.)<br>
        <br>
        So:<br>
        <br>
         - classes have instances, which are objects<br>
         - some classes are identity classes and some are value classes<br>
           - instances of identity classes have identity, are called
        identity objects<br>
           - instances of value classes have no identity, are called
        value objects<br>
         - any objects can be the target of an object reference <br>
           - Polymorphic types like Object or Runnable may refer to
        identity or value objects<br>
         - value objects can be represented/stored/manipulated directly
        as well, like our old friend int<br>
         - legacy primitive are value objects now!<br>
           - everything is an object <br>
         - The type P.ref is a reference type, it consists of references
        to instances of P<br>
         - The type P.val is a value type, it consists of instances of
        P, which are value objects<br>
         - Integer is a reference type, int is a value type <br>
        <br>
        This isn't much different from the previous "VAO" presentation,
        other than being more explicit about saying "value objects"
        rather than just values -- does that help at all?<br>
        <br>
        <br>
        <br>
        <br>
        <br>
      </font></font><br>
    <div class="moz-cite-prefix">On 8/10/2022 3:34 PM, Brian Goetz
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:16431a3f-e3dd-b102-47be-dd41b1b1db44@oracle.com">
      <blockquote type="cite" style="color: #007cff;"><br>
        Does the VAO model feel less forced if we're explicit about
        references being the difference?
        <br>
         - A value object can also be represented without an object
        reference, as primitives are today   // (*)
        <br>
        <br>
      </blockquote>
      <br>
      This is actually the new weirdness -- that you have a choice about
      how to handle a value object.  Previously we had two kinds of
      things: primitives (direct values) and object references (which
      can be null, or can have an object at the end of them, but you
      can't touch the object, only the reference.)  Now we still have
      two kinds of values: value objects, and object references -- but
      object references can also refer to value objects!  This is the
      weird part; that value objects have two separate placements /
      representations / interaction modes.  We got away before without a
      notion of "bare object" because the only way you could touch a
      primitive is directly, and the only way you could touch an object
      is through a reference.  But now some objects can be touched
      directly, <b class="moz-txt-star"><span class="moz-txt-tag">*</span>or<span class="moz-txt-tag">*</span></b> through a reference.
    </blockquote>
    <br>
  </body>
</html>