MAGE::...iation(3pm)

πŸ’– NAME πŸ’–

Bio::MAGE::Array::ArrayManufactureDeviation β€” bestie, it's the class for the MAGE-OM API. That's it, that's the whole name. πŸŽ€

(also this page lives in the User Contributed Perl Documentation section, manual page MAGE::...iation(3pm), if you were wondering where you wandered into πŸ¦‹)


✨ SYNOPSIS ✨

okay so here's the whole vibe in code, no cap:

use Bio::MAGE::Array::ArrayManufactureDeviation

# creating an empty instance
my $arraymanufacturedeviation = Bio::MAGE::Array::ArrayManufactureDeviation->new();

# creating an instance with existing data
my $arraymanufacturedeviation = Bio::MAGE::Array::ArrayManufactureDeviation->new(
      adjustments=>\@zonedefect_list,
      propertySets=>\@namevaluetype_list,
      featureDefects=>\@featuredefect_list,
);

# 'adjustments' association
my $zonedefect_array_ref = $arraymanufacturedeviation->adjustments(); # getter
$arraymanufacturedeviation->adjustments(\@zonedefect_list); # setter

# 'propertySets' association
my $namevaluetype_array_ref = $arraymanufacturedeviation->propertySets(); # getter
$arraymanufacturedeviation->propertySets(\@namevaluetype_list); # setter

# 'featureDefects' association
my $featuredefect_array_ref = $arraymanufacturedeviation->featureDefects(); # getter
$arraymanufacturedeviation->featureDefects(\@featuredefect_list); # setter

getter, setter, getter, setter β€” it's giving very much "same energy, different association" and honestly? iconic. πŸ’…


🌸 DESCRIPTION 🌸

Straight from the MAGE-OM documentation for the ArrayManufactureDeviation class, and I'm quoting here because why would I paraphrase perfection:

Stores information of the potential difference between an array design and arrays that have been manufactured using that design (e.g. a tip failed to print several spots).

so basically: sometimes the design says one thing and the actual printed array says another 😭. A tip just… didn't print several spots. That's the deviation. That's the whole point of this class. It keeps the receipts. 🧾✨


πŸ¦‹ INHERITANCE πŸ¦‹

Bio::MAGE::Array::ArrayManufactureDeviation has the following superclasses, and there's exactly one, so it's a very chill family tree:

  • Bio::MAGE::Extendable

πŸ‘‘ CLASS METHODS πŸ‘‘

Every single one of these can be called without ever making an instance first, bestie β€” you just use the

Bio::MAGE::Array::ArrayManufactureDeviation->methodname()

syntax and you're good. No object required, the class itself will pick up the phone. 🫢

πŸ’– new() πŸ’–

πŸ’– new(%args) πŸ’–

The object constructor new() accepts the following optional named-value style arguments, and yes, all of them are optional, live your truth:

  • adjustments β€” Sets the value of the adjustments association.

The value must be of type: array of Bio::MAGE::Array::ZoneDefect.

  • propertySets β€” Sets the value of the propertySets association (and heads up, this association was inherited from class Bio::MAGE::Extendable, so it's a little hand-me-down πŸ’œ).

The value must be of type: array of Bio::MAGE::NameValueType.

  • featureDefects β€” Sets the value of the featureDefects association.

The value must be of type: array of Bio::MAGE::Array::FeatureDefect.

πŸ’– $obj = class->new(%parameters) πŸ’–

new() is the class constructor. The main character of constructors, honestly.

  • Parameters: if you give it a list of name/value parameters, the corresponding slots, attributes, or associations will have their initial values set by the constructor. πŸŽ€
  • Return value: it returns a reference to an object of the class.
  • Side effects: it invokes the initialize() method if it is defined by the class. Surprise bonus method call, love that for us ✨

πŸ’– @names = class->get_slot_names() πŸ’–

get_slot_names() is how you retrieve the name of all slots defined in a given class.

NOTE: the list of names does not include attribute or association names. Just so we're clear, bestie. No sneaky extras. πŸ™ˆ
  • Return value: a list of the names of all slots defined for this class.
  • Side effects: none. Zero. Nada. A completely drama-free method, we stan. πŸ’…

πŸ’– @name_list = get_attribute_names() πŸ’–

returns the list of attribute data members for this class. πŸ“‹

πŸ’– @name_list = get_association_names() πŸ’–

returns the list of association data members for this class. πŸ”—

πŸ’– @class_list = get_superclasses() πŸ’–

returns the list of superclasses for this class. ⬆️

πŸ’– @class_list = get_subclasses() πŸ’–

returns the list of subclasses for this class. ⬇️

πŸ’– $name = class_name() πŸ’–

Returns the full class name for this class. 🏷️

πŸ’– $package_name = package_name() πŸ’–

Returns the base package name (i.e. no 'namespace::') of the package that contains this class. So like, the short version. The nickname. πŸ₯°

πŸ’– %assns = associations() πŸ’–

returns the association meta-information in a hash where the keys are the association names and the values are Association objects that provide the meta-information for the association. πŸ—‚οΈβœ¨


…and bestie, we are SO not done yet, there's more of this page coming 🌈

πŸ’… INSTANCE METHODS πŸ’…

okay bestie, these are the ones you call on an actual object, not on the class itself. this is where the ✨magic✨ happens.


πŸ¦‹ $obj_copy = $obj->new()

When you hit up new() on an already-existing object reference β€” not a class name β€” it lowkey becomes a copy constructor. the new object's initial values get set to be exactly those of the existing object. it's giving twin energy, but make it a duplicate πŸ‘―

  • Parameters: no input parameters are used in the copy constructor, fr fr β€” the initial values are taken directly from the object to be copied.
  • Return value: it returns a reference to an object of the class.
  • Side effects: it invokes the initialize() method if it is defined by the class.

πŸŽ€ $obj->set_slots(%parameters) and $obj->set_slots(\@name_list, \@value_list)

The set_slots() method is your girl for setting a whole bunch of slots at the same time. she's got two different ways to be invoked, and honestly? iconic of her. the first one takes a named parameter list, the second takes two array references.

  • Return value: none. nothing. nada. πŸ«₯
  • Side effects: will call croak() if a slot_name is used that the class does not define. so don't be out here inventing slots, bestie πŸ’€

🌈 @obj_list = $obj->get_slots(@name_list)

The get_slots() method is used to get the values of a number of slots at the same time. batch retrieval, we love to see it.

  • Return value: a list of instance objects
  • Side effects: none ✨

🌸 $val = $obj->set_slot($name,$val)

The set_slot() method sets the slot $name to the value $val. one slot, one value, no drama.

  • Return value: the new value of the slot, i.e. $val
  • Side effects: none 🫢

🧚 $val = $obj->get_slot($name)

The get_slot() method is used to get the values of a number of slots at the same time. (yes, that's what the page says, and we are keeping it exactly as written πŸ’–)

  • Return value: a single slot value, or undef if the slot has not been initialized. so if you get undef back, that's not a bug, that's just an uninitialized slot being its authentic self πŸ™ˆ
  • Side effects: none ⭐

✨ ATTRIBUTES ✨

Attributes are simple data types that belong to a single instance of a class. In the Perl implementation of the MAGE-OM classes, the interface to attributes is implemented using separate setter and getter methods for each attribute. no shared state, no chaos, just one object's very own little data babies.

Bio::MAGE::Array::ArrayManufactureDeviation has the following attribute accessor methods:

(yes bestie, that list is empty up there πŸ‘€ β€” that's literally all the page gives us, so we're not gonna invent attributes that don't exist. we keep it real.)

πŸ’œ ASSOCIATIONS πŸ’œ

Associations are references to other classes. Associations in MAGE-OM have a cardinality that determines the minimum and maximum number of instances of the 'other' class that maybe included in the association. cardinality is basically the vibe check on "how many of these are allowed here":

  1. There must be exactly one item in the association, i.e. this is a mandatory data field.
  2. 0..1 β€” there may be one item in the association, i.e. this is an optional data field.
  3. 1..N β€” there must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.
  4. 0..N β€” there may be one or more items in the association, i.e. this is an optional data field, with list cardinality.

Bio::MAGE::Array::ArrayManufactureDeviation has the following association accessor methods:

πŸ¦‹ adjustments

Methods for the adjustments association.

From the MAGE-OM documentation:

Descriptions of how a Zone has been printed differently than specified in the ArrayDesign.

$array_ref = $arraymanufacturedeviation->setAdjustments($array_ref)

  • The restricted setter method for the adjustments association.
  • Input parameters: the value to which the adjustments association will be set : a reference to an array of objects of type Bio::MAGE::Array::ZoneDefect
  • Return value: the current value of the adjustments association : a reference to an array of objects of type Bio::MAGE::Array::ZoneDefect
  • Side effects: none
  • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified, or if $array_ref is not a reference to an array class Bio::MAGE::Array::ZoneDefect instances

$array_ref = $arraymanufacturedeviation->getAdjustments()

  • The restricted getter method for the adjustments association.
  • Input parameters: none
  • Return value: the current value of the adjustments association : a reference to an array of objects of type Bio::MAGE::Array::ZoneDefect
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified

$val = $arraymanufacturedeviation->addAdjustments(@vals)

  • Because the adjustments association has list cardinality, it may store more than one value. This method adds the current list of objects in the adjustments association. so you can absolutely pile them in, bestie 🧺
  • Input parameters: the list of values @vals to add to the adjustments association. NOTE: submitting a single value is permitted.
  • Return value: the number of items stored in the slot after adding @vals
  • Side effects: none
  • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not an instance of class Bio::MAGE::Array::ZoneDefect

🌸 propertySets

Methods for the propertySets association.

From the MAGE-OM documentation:

Allows specification of name/value pairs. Meant to primarily help in-house, pipeline processing of instances by providing a place for values that aren't part of the specification proper.

$array_ref = $arraymanufacturedeviation->setPropertySets($array_ref)

  • The restricted setter method for the propertySets association.
  • Input parameters: the value to which the propertySets association will be set : a reference to an array of objects of type Bio::MAGE::NameValueType
  • Return value: the current value of the propertySets association : a reference to an array of objects of type Bio::MAGE::NameValueType
  • Side effects: none
  • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified, or if $array_ref is not a reference to an array class Bio::MAGE::NameValueType instances

$array_ref = $arraymanufacturedeviation->getPropertySets()

  • The restricted getter method for the propertySets association.
  • Input parameters: none
  • Return value: the current value of the propertySets association : a reference to an array of objects of type Bio::MAGE::NameValueType
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified

$val = $arraymanufacturedeviation->addPropertySets(@vals)

  • Because the propertySets association has list cardinality, it may store more than one value. This method adds the current list of objects in the propertySets association.
  • Input parameters: the list of values @vals to add to the propertySets association. NOTE: submitting a single value is permitted.
  • Return value: the number of items stored in the slot after adding @vals
  • Side effects: none
  • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not an instance of class Bio::MAGE::NameValueType

πŸŽ€ featureDefects

Methods for the featureDefects association.

From the MAGE-OM documentation:

Description on features who are manufactured in a different location than specified in the ArrayDesign.

$array_ref = $arraymanufacturedeviation->setFeatureDefects($array_ref)

  • The restricted setter method for the featureDefects association.
  • Input parameters: the value to which the featureDefects association will be set : a reference to an array of objects of type Bio::MAGE::Array::FeatureDefect
  • Return value: the current value of the featureDefects association : a reference to an array of objects of type Bio::MAGE::Array::FeatureDefect
  • Side effects: none
  • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified, or if $array_ref is not a reference to an array class Bio::MAGE::Array::FeatureDefect instances

$array_ref = $arraymanufacturedeviation->getFeatureDefects()

  • The restricted getter method for the featureDefects association.
  • Input parameters: none
  • Return value: the current value of the featureDefects association : a reference to an array of objects of type Bio::MAGE::Array::FeatureDefect
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified

$val = $arraymanufacturedeviation->addFeatureDefects(@vals)

  • Because the featureDefects association has list cardinality, it may store more than one value. This method adds the current list of objects in the featureDefects association.
  • Input parameters: the list of values @vals to add to the featureDefects association. NOTE: submitting a single value is permitted.
  • Return value: the number of items stored in the slot after adding @vals
  • Side effects: none
  • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not an instance of class Bio::MAGE::Array::FeatureDefect

And then, sitting right there at the bottom like a little bonus snack, here's the initialize() subroutine, verbatim because we do not touch the code, ever:

sub initialize {

  my $self = shift;
  return 1;

}

πŸ’– SLOTS, ATTRIBUTES, AND ASSOCIATIONS πŸ’–

okay bestie, so here's the tea β˜• β€” in the Perl implementation of MAGE-OM classes, there are literally three types of class data members: slots, attributes, and associations. Three. Not two. Not four. Keep up πŸ’…


✨ SLOTS ✨

This API uses the term "slot" to mean a data member of the class that was not present in the UML model and exists mainly for internal purposes. so like… use these only if you understand the inner workings of the API, no cap 🫠 Most often slots get used by generic methods, like the ones hanging out in the XML writing and reading classes.

Slots are implemented using unified getter/setter methods:

  • $var = $obj->slot_name(); β€” grabs the current value of the slot 🫳✨
  • $new_var = $obj->slot_name($new_var); β€” stores $new_var in the slot, and the return value is also $new_var (it's giving mirror, it's giving reflect πŸͺž)
  • @names = $obj->get_slot_names() β€” returns the list of all slots in the class πŸ‘‘
DATA CHECKING: No data type checking is made for these methods. none. zero. nada. it will simply not check for you πŸ’€

πŸ¦‹ ATTRIBUTES AND ASSOCIATIONS πŸ¦‹

The terms "attribute" and "association" mean data members of the class that were specified directly from the UML model. so like, the official ones ✨

In the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented using three separate methods:

  • get* β€” retrieves the current value.
NOTE: For associations, if the association has list cardinality, an array reference is returned. πŸŽ€
DATA CHECKING: Ensure that no argument is provided. (yes, hand them nothing, they said what they said πŸ™ˆ)
  • set* β€” sets the current value, replacing any existing value. out with the old, in with the new πŸ’…
NOTE: For associations, if the association has list cardinality, the argument must be an array reference. Because of this, you probably should be using the add* methods. fr fr, listen to the manpage on this one 😭
DATA CHECKING: For attributes, ensure that a single value is provided as the argument. For associations, if the association has list cardinality, ensure that the argument is a reference to an array of instances of the correct MAGE-OM class β€” otherwise ensure that there is a single argument of the correct MAGE-OM class. (she's picky, and honestly? valid πŸ‘‘)
  • add* β€” appends a list of objects to any values that may already be stored in the association.
NOTE: Only present in associations with list cardinality. πŸ“
DATA CHECKING: Ensure that all arguments are of the correct MAGE-OM class.

🌸 GENERIC METHODS 🌸

The unified base class of all MAGE-OM classes, Bio::MAGE::Base, provides a set of generic methods that will operate on slots, attributes, and associations β€” a whole little toolkit, it's giving main character energy πŸ”₯

$val = $obj->get_slot($name)
\@list_ref = $obj->get_slots(@name_list);
$val = $obj->set_slot($name,$val)
$obj->set_slots(%parameters)
$obj->set_slots(\@name_list, \@value_list)

See elsewhere in this page for a detailed description of these methods. (iykyk πŸ‘€)


😭 BUGS 😭

Please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)

like literally just tell them, they want to know 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Jason E. Stewart (jasons 'at' cpan 'dot' org)

the icon, the legend, the moment πŸ’œ


🌈 SEE ALSO 🌈

perl(1).


πŸ’€ POD ERRORS πŸ’€

Hey! The above document had some coding errors, which are explained below:

  • Around line 323:
'=item' outside of any '=over'
  • Around line 408:
You forgot a '=back' before any '=head2'

(okay so the original says: You forgot a '=back' before '=head2' β€” not me being messy, that's the actual text πŸ’–)

  • Around line 436:
Expected '=item 2'
  • Around line 441:
Expected '=item 3'
  • Around line 446:
Expected '=item 4'
the docs are a little unhinged, but honestly? relatable πŸ™ˆβœ¨

okay that's the whole page bestie, we ate and left absolutely no crumbs πŸŽ€ this was MAGE::...iation(3pm) β€” perl v5.32.0, dated 2020-11-27, straight from the User Contributed Perl Documentation archives. mwah πŸ’‹ go forth and slay your objects βœ¨πŸ¦‹πŸ’