Basic HTML version of Foils prepared May 19 99

Foil 23 Method design patterns for Simple Properties

From Javabeans Basic Information Track Computational Science Course CPS616 -- Spring Semester 1999. by Geoffrey Fox, Nancy McCracken, Wojtek Furmanski


1 Giving a set method defines a write property, and a get method defines a read property, according to this pattern: public void set<PropertyName>(<PropertyType> value); public <PropertyType> get<PropertyName> ( ); (where the first letter of PropertyName is decapitalized.)
2 Although the typical actions of the get and set methods are to get the value of and assign to one or more variables representing the property, they may have additional actions.
3 If the property type is boolean, the get() method can be replaced or augmented by a method: public boolean is<PropertyName> ( );

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999