Bioperl-guts: Re: Bioperl: Possible Seq.pm reimplementation

Jeffrey Chang jchang@SMI.Stanford.EDU
Thu, 29 Jul 1999 14:22:04 -0700 (PDT)


Hi Ewan,

I am reading your Seq.pm reimplementation proposal and have a minor
nitpick with some of the terminology you use.

>From the web page:
> http://bio.perl.org/Projects/Sequence/reimpl.html

  An exception to this are methods which rely *solely* on the interface,
  and effective operate on top of the abstract interface. We are currently
  (at least Matt and I are at the Sanger Centre) calling these methods
  decorating methods. For example, an interface could provide methods for

              $obj->start()  # the start point
              $obj->length()  # the length of the object

  which some objects would implement as a lookup into a hash, and other
  objects as a lookup into a database. A decorating method would be

              $obj->end()    # start+length, but no need to reimplement it
                             # achievable from just the start and length
                               interface calls

  Decorating methods, although provided by the interface code can be
  overridden by the implementation. 




Calling these decorating methods is a little confusing for people familiar
with "Design Patterns" because it sounds close to, but is actually
different from the "Decorator" that they describe.  Their decorator
describes a pattern where a class is wrapped around another class and adds
additional functionality by substituting or adding onto the original
method calls.

As a side note, the concept described here, adding an implementation based
completely on abstractions, is used in a (Design Patterns) Bridge pattern. 
I don't know if there's a word specifically for that. 

Nevertheless, I would urge you to call these methods something else.

Jeff

=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl-guts.html
====================================================================