Relative Content

Tag Archive for perl

UML representation of specific factory pattern

I have to create an UML class diagram from the following example code (Perl). I don’t think that the standard factory pattern match in my case or I don’t understand it correctly. I don’t have AbstractFactory and ConcreteFactory but a single Factory.

conventions for friend methods in Perl

Perl doesn’t support a friend relationship between objects, nor does it support private or protected methods. What is usually done for private methods is to prefix the name with an underscore. I occasionally have methods that I think of as friend methods. Meaning that I expect them to be used by a specific object, or an object with a specific responsibility, but I’m not sure if I should make that method public (meaning foo ) or private ( _foo ) or if there’s a better convention? is there a convention for friend methods?