A recent post (Singletons and Inheritance) made me think that we could gather some design patterns in Perl and maintain them in Tutorials - distinct from Snippets Section.

The example above includes an implementation of a Singleton, and whatever feelings we may have toward the use of design patterns, some folks rely upon them, and find themselves reimplementing them in Perl. We can offer good implementations, or at least evolve them.

Anyone agree? Any thoughts?

Replies are listed 'Best First'.
Re: Whither Patterns?
by eserte (Deacon) on Jul 20, 2004 at 14:09 UTC

      It's a monster, with 86 separate footnotes. I wouldn't want that level of detail here.

      But just because something exists "out there" doesn't stop us from providing our own nodes to help our visitors. We provide tutorials on using map, how to use a whole variety of modules, etc, all of which are essentially redundant documentation.

      I'm just wondering if there is spuport for this, as I would guess that there are folks who would welcome it.

Re: Whither Patterns?
by herveus (Prior) on Jul 20, 2004 at 14:07 UTC
Re: Whither Patterns?
by kvale (Monsignor) on Jul 20, 2004 at 13:46 UTC
    I think this is a fine idea. Design patterns are part of the common language of C++ and Java programmers, so some help with translating those concepts would be to our advantage in recruiting new perl programmers.

    If some people believe that design patterns are not terribly useful in perl coding, this section could also contain useful alternatives to the usual class structures.

    -Mark

Re: Whither Patterns?
by Corion (Patriarch) on Jul 20, 2004 at 13:47 UTC

    Isn't that what http://search.cpan.org is for ?

    Personally, I'm no great fan of Patterns as coined by the Gang of Four, as most of them are either trivial in Perl or useless in Perl, and few of them lend themselves to hiding in a module. The Singleton pattern may be such a pattern, but I feel it's the same amount of code to inherit from a Singleton base class as it is to write the code yourself...

    Also, I don't see the need to create a different section for every subdirection of a topic - the Tutorials can have new subsections added though and thus, if you prod footpad long enough, such a section might spring into existence.

      I'm no fan either, but there are folks who are. It might be of service to those folks to provide them with implementations of a few, and accompanying discussion.

      I also wouldn't advocate a new section - I suggested above adding them to Tutorials.