Andrew Maltsev

NAME

XAO::DO::Atom - recommended base object for all XAO dynamic objects

SYNOPSIS

Throwing an error from XAO object:

 throw $self "method - no 'foo' parameter";

DESCRIPTION

Provides some very basic functionality and common methods for all XAO dynamic objects.

Atom (XAO::DO::Atom) was introduced in the release 1.03 mainly to make error throwing uniform in all objects. There are many objects currently not derived from Atom, but that will eventually change.

All new XAO dynamic object should use Atom as their base if they are not already based on dynamic object.

METHODS

new (%)

Generic new - just stores everything that it gets in a hash. Can be overriden if an object uses something different then a hash as a base or needs a different behavior.

throw ($)

Helps to write code like:

 sub foobar ($%) {
    my $self=shift;
    my $args=get_args(\@_);

    my $id=$args->{id} || throw $self "foobar - no 'id' given";
    ...
 }

It is recommended to always use text maessages af the following format:

 "function_name - error description starting from lowercase letter"

There is no need to print class name, it will be prepended to the front of your error message automatically.

EXPORTS

Nothing.

AUTHOR

Copyright (c) 2002 XAO, Inc.

Andrew Maltsev <am@xao.com>.

SEE ALSO

XAO::Objects

1 POD Error

The following errors were encountered while parsing the POD:

Around line 96:

You forgot a '=back' before '=head1'