Skip to content

Types of reference

20090810 (2009 August 10 Monday)

My thought on references in Object Orientated Programming.

A reference is free or fixed:

  • I fixed reference can not be reassigned.
    e.g. reference in (C++), const pointer (C++)
  • A free reference can be reassigned.
    e.g. pointer in (C++), reference in (C#, Java, python …)

A reference is:

  • not null-able: Can point to a valid object: e.g. Eiffel reference
  • null-able: Can point to a valid object or null. e.g. Java, C#, python, Traditional Eiffel, Eiffel null-able reference
  • radical: Can point anywhere. e.g.  pointer, and even a reference in (C++)

A reference refers to something that is:

  • Constant
  • Mutable
Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: