in reply to Mixing OO & non OO code in a module
When doing object-oriented programming, the first thing you should do is make a list of all of the types of objects that you have (or would like to have) in your finished program. Write down their methods and functions too. Arrange them and rearrange them while they are still just names on a piece of paper. It's well worth an hour of your time to come up with a conceptually sound set of object (classes) before you start coding. Another thing to remember about object-oriented programming is that there is no single "right" answer. Lots of different object models could solve your problem. And bear in mind that not everything needs to be an object (or an object's method).
In this particular case though, I think you said it yourself: "it does not make sense to call with a block object." That strongly suggests to me that it probably doesn't belong as part of a "block" object. Perhaps it should be part of a different kind of object (such as "map" for example).
|
|---|