Results 1 to 25 of 77
Thread: It's time to take the OOP plunge
Nov 14, 2007, 12:03 #15
- Join Date
- Sep 2006
- 0 Post(s)
- 0 Thread(s)
McGruf, you just broke 3 fundamental rules that every programmer follows when developing an application:
Reduce public exposure
Seen from the outside the complexity of a class depends upon the number of public methods included in the class. A class which makes one or two methods public is usually easier to understand than a class which makes dozens of them available from the outside.
Classes where the ratio of public/protected methods is low are desirable in that a user of the class only needs to understand the functionality of the methods which are public from the class.
Don’t make assumptions
Don’t make assumptions about why a method has been called or about what the caller of a method wishes to do with the results. (in reference to sticking fingers in power sockets).
Write your classes using the top-down fashion, not bottom-up (starting with details). Top-down is a nice way of successively approaching details of the implementation, ending up with defining primitive methods. The code will be independent of representation since the representation is not known when the higher levels of code are designed.