M
Mark Broadbent
This is probably quite an idiotic question for some of you gurus but I'm
good at asking them
is it generally considered bad form for code in a private class procedure to
access private class variables?
Personally I don't see a problem with it, except that I've got this niggling
thing at the back of my mind stemming back to my Pascal days which I seem to
recall suggested that all procedures should only access data through their
own private vars or via parameters and return values. Adhering to this would
(in my opinion cause design headaches in OOP and unnecessarily bloat code).
e.g.
Class MyClass
{
private string firstName;
private void resetName()
{
firstName = "";
}
//various public methods
.....
}
--
Br,
Mark Broadbent
mcdba , mcse+i
=============
good at asking them
is it generally considered bad form for code in a private class procedure to
access private class variables?
Personally I don't see a problem with it, except that I've got this niggling
thing at the back of my mind stemming back to my Pascal days which I seem to
recall suggested that all procedures should only access data through their
own private vars or via parameters and return values. Adhering to this would
(in my opinion cause design headaches in OOP and unnecessarily bloat code).
e.g.
Class MyClass
{
private string firstName;
private void resetName()
{
firstName = "";
}
//various public methods
.....
}
--
Br,
Mark Broadbent
mcdba , mcse+i
=============