J
Jason
Hello:
First, if this is one of those "questions asked a million times" just say so
and I'll dig a little deeper. If not, then...
I'm curious, is it typical to use member data (properties, attributes, etc.)
as parameters to the class's member functions or would you normally have
parameters that are not data members of the class? Or is it normally a
combination, just depending on circumstances? Did I make sense? If anyone
knows of any books that talk about this, I'd appreciate a title, etc. I
guess I'm asking which is the better design.
Example:
Is it better to have a class like:
//Example with member function parameters as data members
class configWriter
string ConfigFile;
string Data;
string someOtherMemberData;
bool Save(ConfigFile, Data);
or
//Example with member function parameters not as data members
class configWriter
string someDataMember;
bool Save(aConfigFile, someData);
(I left out precise syntax and scope as I didn't think it relevant to the
topic.)
Thanks for your advice,
-Jason
First, if this is one of those "questions asked a million times" just say so
and I'll dig a little deeper. If not, then...
I'm curious, is it typical to use member data (properties, attributes, etc.)
as parameters to the class's member functions or would you normally have
parameters that are not data members of the class? Or is it normally a
combination, just depending on circumstances? Did I make sense? If anyone
knows of any books that talk about this, I'd appreciate a title, etc. I
guess I'm asking which is the better design.
Example:
Is it better to have a class like:
//Example with member function parameters as data members
class configWriter
string ConfigFile;
string Data;
string someOtherMemberData;
bool Save(ConfigFile, Data);
or
//Example with member function parameters not as data members
class configWriter
string someDataMember;
bool Save(aConfigFile, someData);
(I left out precise syntax and scope as I didn't think it relevant to the
topic.)
Thanks for your advice,
-Jason