swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java examples


From: Marcus G. Daniels
Subject: Re: Java examples
Date: 07 Feb 2000 14:17:27 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "CS" == Charles Staelin <address@hidden> writes:

CS> The problem is not the OOP stuff,
CS> but rather what needs to be in the include statements and how
CS> particular methods in the various classes are properly referred to.

You need to import each class or interface that you want to use, or
use a wildcard expression that does the same.

At http://www.santafe.edu/projects/swarm/swarmdocs/refbook-java/index.html,
under "All Classes" are all the interfaces and classes.  When you
click on one of these, the documentation for that feature is shown on
the right.  Note that the Java package is listed in small letters
above the interface/class name.  It is the combination of the package
and class/interface name that you use as the argument to import.

Interfaces are the preferred data type for variables and argument
types.  Interfaces either have no suffix, or a "C" or "S" suffix.  The
common `using phase' methods are named by interfaces without a suffix.
The methods you use when you are describing an object to instantiate
it are in the interface with the "C" suffix (the `creating phase').
The "S", `setting phase' methods are usable in either using or
creating phase.

The actual implementation classes have the suffix "Impl".  Whenever
you want to instantiate an object, you'll use one of these as an
argument to "new", and most of the time it will be with a class in
the using phase, not the creating phase.  (The reason for this is
that most using-phase implementation classes have `common usages'
of just a few arguments, that take care to run the creating phase,
apply the arguments, and then finish it in one step.)

Typical code for creating an object and assigning to a variable is:
  
  Something obj = new SomethingImpl (aZone);


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]