Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31754

Re: Wiring: A topic underrepresented in teaching?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Wiring: A topic underrepresented in teaching?
Date 2015-06-01 16:00 -0400
Organization A noiseless patient Spider
Message-ID <mkidhs$r7j$1@dont-email.me> (permalink)
References <wiring-20150601205821@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 6/1/2015 3:07 PM, Stefan Ram wrote:
>    Do you agree with my following definition?
>
>    Definition: When a reference to an object B is being
>    stored in an object A, this is called /wiring/.

     In what sense can one "agree" with a definition?  A definition
attaches a name to a thing, and the name is pretty much arbitrary:
If you changed /wiring/ to /lending/ every part of the revised
definition would be just as valid as the original.  Definitions are
(by definition!) "correct."

     The "goodness" of a definition, though, can be judged.  In a case
like the present, where the name being defined is already assigned to
things other than the new one, it can be suggestive -- helpfully or
harmfully, to a greater or lesser extent.  The term /wiring/ suggests
a connection, and is thus more helpful than, say, /dieting/.  But
/wiring/ also carries connotations of "flow," which seem at best
irrelevant to the notion of reference.  Also, /wiring/ in the existing
use suggests a bi-directional connection (tug on either end of a wire
and the other will feel the pull), and this is at odds with the
unidirectional nature of Java references.  So, although /wiring/ has
merit I do not think I'd abandon the search for a better definition.

>    Now, one can make this observation:
>
>    When a non-trivial Java program is being started, it builds
>    an /object graph/ by creating and wiring objects. In a
>    sense, this object graph then is »executed« by the program.
>    Sometimes, it is being changed in the process of this execution.

     The notion of an object graph is surely unobjectionable -- how
could one explain reference-based garbage collection without in some
way introducing it?  But I'm not so sure that Java "executes" its
object graph in any useful sense.  Java maintains a distinction between
data and code, the code residing in methods and so on, while the data
resides in objects (for the most part).  Yes, there are facilities that
transform data into code and vice versa, but the transformations are
too, well, "obtrusive" to fit comfortably with the notion that Java
"executes" an object graph.

     Ultimately, a Java object is a container of primitives and
references.  The object belongs to a class and is therefore associated
with executable code, but I don't think it's helpful to characterize
primitives and references as "executable."

>    Is it possible that the important notion of »wiring« and the
>    observation that wiring creates an object graph (and calling
>    this an »object graph«) often is underrepresented in many
>    Java books / tutorials?

     "Is it possible?"  Sure.  "Is it actual?"  Beats me.

>    (To me, wiring seems to be even more fundamental than IoC.
>    One can teach wiring and the object graph first without IoC
>    and then introduce IoC and similar ideas later.)

     I live near Boston, Massachusetts, USA, and the less I hear
about 2024 and the IOC the happier I'll be.  ;)

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Wiring: A topic underrepresented in teaching? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-01 16:00 -0400
  Re: Wiring: A topic underrepresented in teaching? Arne Vajhøj <arne@vajhoej.dk> - 2015-06-03 21:24 -0400

csiph-web