[Bioperl-l] question of seq() method of Bio::DB::GFF and Bio::PrimarySeq

Adam Sjøgren adsj at novozymes.com
Sun Jan 30 12:10:57 UTC 2011


On Fri, 28 Jan 2011 13:57:25 +0700, chirag wrote:

> Objects in Bioperl are References ,generally  hash references,where keys are
> attributes like name and source of sequence

> So to get values , You need to Deference them to fetch values stored at the
> memory location.

> my $hash_value=$hash_ref->{'some_key'};

Generally the object provides methods (accessors) for all the
information that it wants to expose.

Bypassing that and going directly into the internal datastructure of the
object ("breaking encapsulation") can be okay when you are debugging the
code implementing the objects, but it is good practise to respect and
use the interfaces otherwise (the internals of the object might change
while the documented interface stays the same).

So I would say: Look up the methods to call in the documentation and
avoid accessing in the internal representation of the objects directly.


  Best regards,

    Adam

-- 
                                                          Adam Sjøgren
                                                    adsj at novozymes.com




More information about the Bioperl-l mailing list