MAGE::...cation(3pm)

πŸ’– NAME πŸ’–

Bio::MAGE::Protocol::ParameterizableApplication β€” it's the class for the MAGE-OM API, bestie. That's the whole vibe. ✨

Oh and for the record, this page is MAGE::...cation(3pm) out of the User Contributed Perl Documentation set, so you know where you are. 🫢


✨ SYNOPSIS ✨

Okay so before you do literally anything, here's the ritual:

  use Bio::MAGE::Protocol::ParameterizableApplication

  # Bio::MAGE::Protocol::ParameterizableApplication is an abstract base class and should not
  # be directly instantiated. These examples indicate how subclass
  # objects will behave

  # 'auditTrail' association
  my $audit_array_ref = $parameterizableapplication->auditTrail(); # getter
  $parameterizableapplication->auditTrail(\@audit_list); # setter

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

  # 'descriptions' association
  my $description_array_ref = $parameterizableapplication->descriptions(); # getter
  $parameterizableapplication->descriptions(\@description_list); # setter

  # 'security' association
  my $security_ref = $parameterizableapplication->security(); # getter
  $parameterizableapplication->security($security_ref); # setter

  # 'parameterValues' association
  my $parametervalue_array_ref = $parameterizableapplication->parameterValues(); # getter
  $parameterizableapplication->parameterValues(\@parametervalue_list); # setter

Read it again. Notice how every one of these is like "getter, setter, getter, setter" β€” that's the whole pattern of this class and honestly it's so satisfying. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

Straight from the MAGE-OM documentation for the ParameterizableApplication class, and I'm quoting here, no notes:

The interface that is the use of a Parameterizable class.

And then the part that matters, okay, the part you cannot skip, no cap:

Bio::MAGE::Protocol::ParameterizableApplication is an abstract base class and should not be directly instantiated. It's literally not that kind of girl. Instead, it serves as an interface definition for its subclasses. So you don't build this β€” you build the things that inherit from it. Periodt. πŸ’…


πŸ¦‹ INHERITANCE πŸ¦‹

Superclasses (the ancestors, the family tree, the lineage πŸ‘‘)

Bio::MAGE::Protocol::ParameterizableApplication has the following superclasses:

  • Bio::MAGE::Describable

Subclasses (the children, the ones who actually get instantiated 🌸)

Bio::MAGE::Protocol::ParameterizableApplication has the following subclasses:

  • Bio::MAGE::Protocol::ProtocolApplication
  • Bio::MAGE::Protocol::HardwareApplication
  • Bio::MAGE::Protocol::SoftwareApplication

πŸ‘‘ CLASS METHODS πŸ‘‘

So here's the tea: all of these can be called without making an instance first. You just go straight in with the Bio::MAGE::Protocol::ParameterizableApplication->methodname() syntax. No object required, no waiting, main character energy. ✨

new()

new(%args)

Bio::MAGE::Protocol::ParameterizableApplication is an abstract base class and should not be directly instantiated using the new() constructor. It's listed here anyway so you know what arguments its subclasses will accept β€” like a menu you're allowed to read but not order from. 😭

The object constructor new() accepts the following optional named-value style arguments:

  • auditTrail β€” sets the value of the auditTrail association (and yes, this association was inherited from the class Bio::MAGE::Describable).

The value must be of type: array of Bio::MAGE::AuditAndSecurity::Audit.

  • propertySets β€” sets the value of the propertySets association (inherited from the class Bio::MAGE::Extendable).

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

  • descriptions β€” sets the value of the descriptions association (inherited from the class Bio::MAGE::Describable).

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

  • security β€” sets the value of the security association (inherited from the class Bio::MAGE::Describable).

The value must be of type: instance of Bio::MAGE::AuditAndSecurity::Security.

  • parameterValues β€” sets the value of the parameterValues association.

The value must be of type: array of Bio::MAGE::Protocol::ParameterValue.


$obj = class->new(%parameters)

The new() method is the class constructor. The blueprint moment. πŸ—οΈ

  • Parameters: if you hand it a list of name/value parameters, the corresponding slots, attributes, or associations get 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's defined by the class.

@names = class->get_slot_names()

The get_slot_names() method retrieves the name of all slots defined in a given class.

NOTE: the list of names does not include attribute or association names. Like, it's just the slots, okay, don't come for me. πŸ’€
  • Return value: a list of the names of all slots defined for this class.
  • Side effects: none.

@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. (The ancestors. Respect them. πŸ‘‘)


@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.


%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.


πŸ’… INSTANCE METHODS πŸ’…

$obj_copy = $obj->new()

When you invoke this with an existing object reference instead of a class name, new() acts as a copy constructor β€” the new object's initial values get set to those of the existing object. Duplicate her, she's iconic. πŸ’…

  • Parameters: no input parameters are used in the copy constructor; 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's defined by the class.

$obj->set_slots(%parameters)

$obj->set_slots(\@name_list, \@value_list)

The set_slots() method sets a bunch of slots at the same time. It has two different invocation methods: the first takes a named parameter list, and the second takes two array references. Pick your fighter. πŸŽ€

  • Return value: none.
  • Side effects: will call croak() if a slot_name is used that the class does not define. 🫠

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

The get_slots() method gets the values of a bunch of slots at the same time.

  • 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.

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

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

The get_slot() method gets the values of a bunch of slots at the same time.

  • Return value: a single slot value, or undef if the slot has not been initialized.
  • 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.

Bio::MAGE::Protocol::ParameterizableApplication has the following attribute accessor methods:

(that's it, that's the list β€” nothing below, don't panic, it's not you, it's the class πŸ’€)


🌈 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 may be included in the association:

  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::Protocol::ParameterizableApplication has the following association accessor methods:


auditTrail

Methods for the auditTrail association.

From the MAGE-OM documentation:

A list of Audit instances that track changes to the instance of Describable.

$array_ref = $parameterizableapplication->setAuditTrail($array_ref)

The restricted setter method for the auditTrail association.

  • Input parameters: the value to which the auditTrail association will be set β€” a reference to an array of objects of type Bio::MAGE::AuditAndSecurity::Audit.
  • Return value: the current value of the auditTrail association β€” a reference to an array of objects of type Bio::MAGE::AuditAndSecurity::Audit.
  • 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 of class Bio::MAGE::AuditAndSecurity::Audit instances. 😭

$array_ref = $parameterizableapplication->getAuditTrail()

The restricted getter method for the auditTrail association.

  • Input parameters: none.
  • Return value: the current value of the auditTrail association β€” a reference to an array of objects of type Bio::MAGE::AuditAndSecurity::Audit.
  • Side effects: none.
  • Exceptions: will call croak() if any input parameters are specified.

$val = $parameterizableapplication->addAuditTrail(@vals)

Because the auditTrail association has list cardinality, it may store more than one value. This method adds the current list of objects in the auditTrail association. 🫢

  • Input parameters: the list of values @vals to add to the auditTrail 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::AuditAndSecurity::Audit.

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 = $parameterizableapplication->setPropertySets($array_ref)

The restricted setter method for the propertySets association.

  • $array_ref = $parameterizableapplication->setPropertySets($array_ref) β€” the restricted setter for the propertySets association πŸ’…
    • Input parameters: the value you're setting the propertySets association to β€” a reference to an array of objects of type Bio::MAGE::NameValueType.
    • Return value: whatever propertySets is holding right now β€” a reference to an array of objects of type Bio::MAGE::NameValueType.
    • Side effects: none, bestie, it's a clean setter.
    • Exceptions: it will call croak() if you pass no input parameters, if you pass too many, or if $array_ref isn't a reference to an array of Bio::MAGE::NameValueType instances. So like... read the room, ok? πŸ™ˆ
  • $array_ref = $parameterizableapplication->getPropertySets() β€” the restricted getter for the propertySets association ✨
    • Input parameters: none. Zero. Nada.
    • Return value: the current value of propertySets β€” a reference to an array of objects of type Bio::MAGE::NameValueType.
    • Side effects: none.
    • Exceptions: will call croak() if you specify any input parameters. She doesn't take requests, she only gives. πŸ‘‘
  • $val = $parameterizableapplication->addPropertySets(@vals) β€” because propertySets has list cardinality it can hold more than one value, so this one adds to the current list of objects in the association 🌸
    • Input parameters: the list of values @vals to add to propertySets. NOTE: submitting a single value is permitted. (One is fine! Nobody's judging!)
    • 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 object in @vals isn't an instance of class Bio::MAGE::NameValueType.

descriptions πŸ’–

Methods for the descriptions association.

Straight from the MAGE-OM documentation:

Free hand text descriptions. Makes available the associations of Description to an instance of Describable.
  • $array_ref = $parameterizableapplication->setDescriptions($array_ref) β€” the restricted setter for the descriptions association.
    • Input parameters: the value you're setting descriptions to β€” a reference to an array of objects of type Bio::MAGE::Description::Description.
    • Return value: the current value of the descriptions association β€” a reference to an array of objects of type Bio::MAGE::Description::Description.
    • Side effects: none.
    • Exceptions: will call croak() if no input parameters are specified, if too many input parameters are specified, or if $array_ref isn't a reference to an array of class Bio::MAGE::Description::Description instances.
  • $array_ref = $parameterizableapplication->getDescriptions() β€” the restricted getter for the descriptions association.
    • Input parameters: none.
    • Return value: the current value of the descriptions association β€” a reference to an array of objects of type Bio::MAGE::Description::Description.
    • Side effects: none.
    • Exceptions: will call croak() if any input parameters are specified.
  • $val = $parameterizableapplication->addDescriptions(@vals) β€” since the descriptions association has list cardinality it may store more than one value, and this method adds the current list of objects in the descriptions association πŸŽ€
    • Input parameters: the list of values @vals to add to the descriptions 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 isn't an instance of class Bio::MAGE::Description::Description.

security πŸ”

Methods for the security association.

From the MAGE-OM documentation:

Information on the security for the instance of the class.
  • $val = $parameterizableapplication->setSecurity($val) β€” the restricted setter for the security association.
    • Input parameters: the value you're setting security to β€” one of the accepted enumerated values.
    • Return value: the current value of the security association β€” one of the accepted enumerated values.
    • Side effects: none.
    • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified, or if $val isn't an instance of class Bio::MAGE::AuditAndSecurity::Security.
  • $val = $parameterizableapplication->getSecurity() β€” the restricted getter for the security association.
    • Input parameters: none.
    • Return value: the current value of the security association β€” an instance of type Bio::MAGE::AuditAndSecurity::Security.
    • Side effects: none.
    • Exceptions: will call croak() if any input parameters are specified.

parameterValues 🧚

Methods for the parameterValues association.

From the MAGE-OM documentation:

The parameter values for this Parameterizable Application.
  • $array_ref = $parameterizableapplication->setParameterValues($array_ref) β€” the restricted setter for the parameterValues association.
    • Input parameters: the value you're setting the parameterValues association to β€” a reference to an array of objects of type Bio::MAGE::Protocol::ParameterValue.
    • Return value: the current value of the parameterValues association β€” a reference to an array of objects of type Bio::MAGE::Protocol::ParameterValue.
    • 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 isn't a reference to an array of class Bio::MAGE::Protocol::ParameterValue instances.
  • $array_ref = $parameterizableapplication->getParameterValues() β€” the restricted getter for the parameterValues association.
    • Input parameters: none.
    • Return value: the current value of the parameterValues association β€” a reference to an array of objects of type Bio::MAGE::Protocol::ParameterValue.
    • Side effects: none.
    • Exceptions: will call croak() if any input parameters are specified.
  • $val = $parameterizableapplication->addParameterValues(@vals) β€” because the parameterValues association has list cardinality it may store more than one value, so this method adds the current list of objects in the parameterValues association 🫢
    • Input parameters: the list of values @vals to add to the parameterValues 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 isn't an instance of class Bio::MAGE::Protocol::ParameterValue.

And then, the moment of truth β€” here's initialize, and bestie, she is not here for being instantiated:

sub initialize {

  carp __PACKAGE__ . "::initialize: abstract base classes should not be instantiated";

}

✨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS ✨

Okay so in the Perl implementation of MAGE-OM classes there are exactly three kinds of class data members, and you gotta know the difference or you'll be out here living a lie: slots, attributes, and associations. πŸ’«

🧩 SLOTS

This API uses the word slot for a data member of the class that wasn't in the UML model β€” it's mainly there for internal purposes, so only touch it if you genuinely understand the inner workings of the API. Most of the time slots get used by generic methods, like the ones in the XML writing and reading classes.

Slots run on 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.
  • @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. It just vibes. πŸ’€

🌈 ATTRIBUTES AND ASSOCIATIONS

The terms attribute and association mean data members of the class that came directly from the UML model.

In the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented as 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.
  • set* β€” sets the current value, replacing whatever was there before.
    • NOTE: for associations, if the association has list cardinality, the argument must be an array reference. Because of that, you probably should be using the add* methods instead. (The add* girlies know. iykyk. πŸ’…)
    • DATA CHECKING: for attributes, ensure that a single value is provided as the argument. For associations, if the association has list cardinality, ensure the argument is a reference to an array of instances of the correct MAGE-OM class β€” otherwise, ensure there's a single argument of the correct MAGE-OM class.
  • add*
    • NOTE: only present in associations with list cardinality.
    • Appends a list of objects to any values that may already be stored in the association.
    • 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, hands you a whole set of generic methods that operate on slots, attributes, and associations:

$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. πŸ‘€


πŸ› BUGS

Please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net). Fr fr, they want to hear from you. 🫢

πŸ‘‘ AUTHOR

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

πŸ”­ SEE ALSO

perl(1).

🫠 POD ERRORS 🫠

okay bestie sit down for a sec πŸ’– the doc you just read? she's gorgeous, she's iconic, she ate… but she also had some coding errors, and Perl is being so real about it. here's the tea, explained below:

  • Around line 348:
'=item' outside of any '=over'

like… girl. you dropped an =item and never opened an =over first?? it's giving orphaned bullet point 😭

  • Around line 433:
You forgot a '=back' before '=head2'

you opened a list and then just walked away into a =head2 without ever closing it. not me leaving the =back on read πŸ™ˆ

  • Around line 461:
Expected '=item 2'
  • Around line 466:
Expected '=item 3'
  • Around line 471:
Expected '=item 4'

bestie the numbering… it started at =item 1 and then said and that's the whole list actually πŸ’€ Perl counted to one and gave up. we need =item 2, =item 3, and =item 4 where they belong, no cap.


lowkey these are all just POD formatting issues, not like… your code being broken. the vibes are off, not the logic. fix the list markers and she's perfect again ✨

and that's a wrap on this whole page, bestie πŸŽ€ you made it to the very end, which is main character energy fr fr πŸ‘‘

the version info living down at the bottom says this is perl v5.32.0, dated 2020-11-27, and it's filed under MAGE::...cation(3pm) β€” so if you ever need to cite your sources, that's the receipt πŸ§ΎπŸ’…

go forth and slay your documentation πŸŒˆπŸ’œ