On Apr 8, 2019, at 4:50 PM, Doug Lea <d...@cs.oswego.edu> wrote:
> 
> On 4/8/19 6:44 PM, John Rose wrote:
> 
>> If we move terms around so "value" gets replaced by "inline",
>> and "reference" by "indirect", only the first two lines are
>> affected:
>> 
>> “inline object”, “indirect object” (also inline or indirect instance)
>> “inline class”, “indirect class” (also inline or indirect type)
>> 
> 
> It would be nice not to use new terms for old concepts (even if new to
> Java).

FTR, I agree and that's why I like "inline" and "indirect".

> For alternative terminology originally stemming from similar
> struggles to make such distinctions, see UML "Composition" vs
> "aggregation" (also vs "association"). Wikipedia has some definitions:
> https://en.wikipedia.org/wiki/Class_diagram#Aggregation

Quote from there: "Furthermore, there is hardly a difference
between aggregations and associations during implementation…"

That's the problem with UML:  It's too abstract.  It doesn't
give any guidance about implementation (nor should it).

But the JVM needs to set expectations about dynamics
as well as semantics, which means there's some hinting
about implementation.  Hence "inline" not "aggregation"
and "indirect" not "associated".  UML-native distinctions
like 1-1 vs. 1-N don't (AFAICS) help use describe this
lower-level distinction.

The deep reason for this is hidden in the JVMS word "same".
Only a single JVM heap block is the "same object" as itself,
if the object is a heap/indirect/regular object, which possesses
a unique identity tracked from def to use.  An inline object
can be the "same object" as another inline object even if
both occurrences of the "same object"  have independent
defs.

UML has a provision for describing state changes, but gives
less help in characterizing objects which have no state.
It seems to me that UML allows any object to have state,
potentially.  The abstraction might not let you observe the
state, but it might be there.  If UML were more explicit about
object equivalence (==) we could mine terms out of there.
I'm not enough of a UML expert to find if or where such
terms occur.

Googling takes me to https://www.uml-diagrams.org/object.html
where I find this definition of Object from UML 1.4.2:

> An entity with a well defined boundary and identity that
> encapsulates state and behavior. 


There's a more nuanced one in UML 2.5, but it's still not
useful AFAICS:

> An object is an individual [thing] with a state and relationships
> to other objects.


Looking at UML this little bit does suggest the modifier
"stateless" (entailing "don't use UML on me"?) as an
alternative to "value" and "inline".  I prefer a positive
term to a privative one, when possible, so "inline" is
better for me than "stateless" ("that which has no state").

It's not like the UML experts are looking at the last
two decades of our thrashing out the value model,
and saying "yep, we wondered when you would get
here".  They are as stuck in the Smalltalk model as
we were.

— John

> The UML specs say more but behind wall at https://www.omg.org/spec/UML
> 
> -Doug
> 

Reply via email to