[Bluej-discuss] How to call an accessor method in a different class?
Bruce Barton
bartonb at sunysuffolk.edu
Sun Nov 18 16:46:21 GMT 2007
I have to agree with Stephen on this one. In an academic environment the key should be to help the students understand the concepts and not worry too much about efficiency or standard practice in industry. They will have time to learn that in a course in Software Engineering. In a first Java course they need to understand that fields and methods are always associated with object instances (or classes in the case of static fields and methods) and that the format is, as Stephen has described, object.field or object.method(args). This gives the student one less "special case" to worry about (i.e., if the field or method is part of this class we can exclude the "this." in front of the field or method). The goal in teaching is to foster understanding first and efficiency/common practice second.
Bruce Barton
Asst. Professor of Computer Science
Suffolk County Community College
________________________________
From: bluej-discuss-bounces at bluej.org on behalf of Aryeh M. Friedman
Sent: Sun 11/18/2007 10:54 AM
To: General discussion for users of BlueJ
Subject: Re: [Bluej-discuss] How to call an accessor method in a different class?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>
> This might be a little easier if the first question or two had less
> magic in them -- in particular, the automatic "this" shortcut. When
> I teach this stuff, I expect EVERY field reference to be of the form
> OBJECT.FIELDNAME, and EVERY method call to be of the form
> OBJECT.METHOD(ARGS); if the field or method is in the current object,
> my students are expected to use "this" explicitly as the OBJECT.
a) overkill?
b) teaches bad habits (i.e. non-standard style)
- --
Aryeh M. Friedman
Developer, not business, friendly
http://www.flosoft-systems.com <http://www.flosoft-systems.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org <http://enigmail.mozdev.org/>
iD8DBQFHQGAWJ9+1V27SttsRAgLWAKCo3hMemZxmw+i24jQz2oh+Qd08PgCgnW59
TuK4n2Aabd4g/xDLx5kzn0s=
=DJSI
-----END PGP SIGNATURE-----
_______________________________________________
mailing list bluej-discuss at bluej.org
To unsubscribe or change your preferences, go to
http://lists.bluej.org/mailman/listinfo/bluej-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20071118/736319fa/attachment.html
More information about the bluej-discuss
mailing list