MAGE::...ciation(3pm)

πŸ’– MAGE::...ciation(3pm) πŸ’–

okay bestie, grab your iced coffee because we're diving into MAGE::...ciation(3pm) and it's giving iconic Perl documentation energy. no cap, this is the manual page for the Bio::MAGE::Association class and its Bio::MAGE::Association::End bestie. let's go πŸ’…


Bio::MAGE::Association πŸ¦‹

SYNOPSIS ✨

         use Bio::MAGE::Association qw(:CARD);

         # creating an empty instance
         my $association = Bio::MAGE::Association->new();

         # populating the instance in the constructor
         my $association = Bio::MAGE::Association->new(self=>$assoc_end1,
                                                              other=>$assoc_end2);

         # setting and retrieving the association ends
         my $self_end = $association->self();
         $association->self($value);

         my $other_end = $association->other();
         $association->other($value);

DESCRIPTION πŸ’–

So this class is literally holding the two association ends for each UML association. self is the end nearest the class of interest, and other is the end furthest away. The ends are of type Bio::MAGE::Association::End. periodt.

CARDINALITY πŸŽ€

Associations in UML have a "cardinality" that determines how many objects can be associated. In the Bio::MAGE::Association modulte (yes, modulte, we're keeping the typo, it's part of the vibe), "cardinality" has two primary dimensions: optional or required, and single or list. So there are four combinations of the two dimensions:

  • 0..1 β€” This is an optional single association, meaning it can have one object associated, but it is optional.
  • 1 β€” This is a required single association, meaning it must have exactly one object associated.
  • 0..N β€” This is an optional list association, meaning it can have many objects associated.
  • 1..N β€” This is an required list association, meaning it must have at least one object, but it may have many.

There are four constants defined in this module for handling the cardinalities, and they can be imported into an application using the CARD import tag:

use Bio::MAGE::Association qw(:CARD);

The four constants are: CARD_0_OR_1, CARD_1, CARD_0_TO_N, and CARD_1_TO_N.


Bio::MAGE::Association::End 🌸

SYNOPSIS ✨

         use Bio::MAGE::Association qw(:CARD);

         # creating an empty instance
         my $assoc_end = Bio::MAGE::Association::End->new();

         # populating the instance in the constructor
         my $assoc_end = Bio::MAGE::Association::End->new(
                                                       name=>$name,
                                                       is_ref=>$bool,
                                                       cardinality=>CARD_0_TO_N,
                                                       class_name=>$class_name,
                                                       documentation=>$doc_string,
                                                       rank=>$rank,
                                                       ordered=>$bool,
                                                      );

         # setting and retrieving object attributes
         my $name = $assoc_end->name();
         $assoc_end->name($value);

         my $is_ref = $assoc_end->is_ref();
         $assoc_end->is_ref($value);

         my $cardinality = $assoc_end->cardinality();
         $assoc_end->cardinality($value);

         my $class_name = $assoc_end->class_name();
         $assoc_end->class_name($value);

         my $documentation = $assoc_end->documentation();
         $assoc_end->documentation($value);

         my $rank = $assoc_end->rank();
         $assoc_end->rank($value);

         my $ordered = $assoc_end->ordered();
         $assoc_end->ordered($value);

         #
         # Utility methods
         #

         # does this end of list cardinality (0..N or 1..N)
         my $bool = $assoc_end->is_list();

DESCRIPTION πŸ’œ

This class stores the information in a single UML association end. that's it, that's the tea. 🍡


okay bestie, that's the whole manual. this page was served fresh by perl v5.32.0 on 2020-11-27, and it's the MAGE::...ciation(3pm) manual. slay, you're welcome πŸ’…βœ¨