|
Exactly my thoughts... What I was thinking is that if I accessed the instance variables directly, when I needed to add some validation (or some other code), I'd have to retrofit those accesses to use the getter/setter methods... How much overhead does using getter/setter methods (for that matter, any classes) incur? Not sure how much work the JVM has to do to get to the code, especially if the class has already been instantiated. I assume the JVM has to work harder (I/O, linkage issues) if the class is located somewhere else (different package, for example). Anyone have some field experience here??? thanks dan -----Original Message----- From: Jim Langston [mailto:jlangston@celsinc.com] Sent: Monday, April 08, 2002 2:01 PM To: 'java400-l@midrange.com' Subject: RE: Java Style Question <snip> If, on the other hand, there was validity checking in the Set method then I would use the Set method instead if I wanted that validity checking in the method I was coding. <snip>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.