in reply to RE: RE: Power of single objects
in thread Power of single objects
In my opinion, there are many types of modules that, for whatever reason, unnecessarily go with an OO approach, even though the paradigm doesn't quite fit, and we get little benefit out if it. I really don't know how to describe the best way to decide. For me, I just look at my package in both ways. If it "feels" right in an object point of view, if I can see a benefit to creating multiple "instances" of my module in the form of objects and toss those around, I'll build it in OO style. If my resulting implementation is going to be a lot more efficient and simpler in a functional style, I'll go that route. Perhaps it's just personal preference...use Object; my $obj = new Object; $obj->some_operation($item); $obj->some_variable($argument); $obj->some_operation($item); # versus use Object; some_operation($item); some_operation($item, $argument);
|
|---|