| App-Context documentation | view source | Contained in the App-Context distribution. |
App::ValueDomain - Interface for sharing data between processes
use App;
$context = App->context();
$dom = $context->service("ValueDomain");
$dom = $context->value_domain();
A ValueDomain service represents a single hash in which scalars or deep references may be stored (basically an MLDBM).
The following classes might be a part of the ValueDomain Class Group.
A ValueDomain service represents an array of values and the labels by which those values may be displayed.
* Throws: App::Exception::ValueDomain * Since: 0.01
* Signature: $values = $dom->values();
* Signature: $values = $dom->values($values_string);
* Param: $values_string string
* Return: $values HASH
* Throws: App::Exception::ValueDomain
* Since: 0.01
Sample Usage:
$context = App->context();
$dom = $context->value_domain("product_type");
$values = $dom->values();
print @$values, "\n";
* Signature: $labels = $dom->labels();
* Signature: $labels = $dom->labels($values_string);
* Param: $values_string string
* Return: $labels HASH
* Throws: App::Exception::ValueDomain
* Since: 0.01
Sample Usage:
$context = App->context();
$dom = $context->value_domain("product_type");
$labels = $dom->labels();
print %$labels, "\n";
* Signature: ($values, $labels) = $dom->values_labels();
* Signature: ($values, $labels) = $dom->values_labels($values_string);
* Param: $values_string string
* Return: $values HASH
* Return: $labels HASH
* Throws: App::Exception::ValueDomain
* Since: 0.01
Sample Usage:
$context = App->context();
$dom = $context->value_domain("product_type");
($values, $labels) = $dom->values_labels();
foreach $value (@$values) {
print "$value => $labels->{$value}\n";
}
* Signature: $label = $dom->get_label($value);
* Param: $value string
* Return: $label string
Sample Usage:
$context = App->context();
$dom = $context->value_domain("product_type");
$label = $dom->get_label($value);
The _load() method is called to get the list of valid values in a data domain and the labels that should be used to represent these values to a user.
* Signature: $self->_load()
* Signature: $self->_load($values_string)
* Param: $values_string string
* Return: void
* Throws: App::Exception
* Since: 0.01
Sample Usage:
$self->_load();
Returns 'ValueDomain';
* Signature: $service_type = App::ValueDomain->service_type();
* Param: void
* Return: $service_type string
* Since: 0.01
$service_type = $sdata->service_type();
* Author: Stephen Adkins <spadkins@gmail.com> * License: This is free software. It is licensed under the same terms as Perl itself.
App::Context|App::Context,
App::Service|App::Service
| App-Context documentation | view source | Contained in the App-Context distribution. |