My training (from Conway) tells me that this is object-oriented code. The question I run into is, "When should I bless a hash pointer to make Real Perl OOTM code?"
My answer is, "As soon as the API that I want to create benefits from it."
It's all about the interface. I imagine that my subroutine calls look good, and are nicely documented with POD. The synopsis section of the POD is a working program that easily solves a real problem. The calls are easy-to-read and self-documenting.
The bless statement makes it possible to create a better API under some circumstances. If I'm not going to make a good API, I don't bother with the trappings of OO.
If I can imagine a good API, then it is worthwhile to fulfill my vision and implement it with the tools that are available. When I write this code, I often need a bless statement.
Without the vision of a good API, the rules of thumb for "when to use OO" do not inspire me enough to bless my objects. I save my blessings for objects that I want to be proud of!
In reply to Re: When are packages the right design choice?
by toma
in thread When are packages the right design choice?
by fuzzyping
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |