>and pass values using set and get functions
If possible, set and get member functions should be avoided. The only advantage is that data members can be accessed through a controlled interface, but a well designed class will hide its internals properly, thus making the need for get and set member functions unnecessary. Here are a few guidelines for designing classes, concerning data members:
1) All data members are private.
2) If possible, access to data members should not rely on the type of data.
3) All outside forces (including derived types) should work through a public (or protected) interface only.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004