T
Ted Byers
Here is a class created by wsdl2perl.pl, most of which I understand (I'll interject comments representing my understanding and end with the questions):
# obviously I haven't quoted the whol file, but rather the key components
# these I understand as private data members of the class, wth some
# syntactic sugar (ATTR) provided by the class package to automagically make
# the read accessor function (very nice)
my %id_of :ATTR
get<id>);
my %type_of :ATTR
get<type>);
my %name_of :ATTR
get<name>);
my %size_of :ATTR
get<size>);
my %extension_of :ATTR
get<extension>);
my %file_of :ATTR
get<file>);
# I can't find the documentation for this function
# I know wha a factory is in OOP, having written enough of them in C++, but
# I can't find the documentation for this function, and I am especially
# interested in knowing what the arguments are supposed to be and how they're
# used.
# obviously the first appears to be an array reference to an array with field
# names, and the second two are hashes mapping the field names to hashes and
# their types
__PACKAGE__->_factory(
[ qw( id
type
name
size
extension
file
) ],
{
'id' => \%id_of,
'type' => \%type_of,
'name' => \%name_of,
'size' => \%size_of,
'extension' => \%extension_of,
'file' => \%file_of,
},
{
'id' => 'SOAP::WSDL::XSD::Typelib::Builtin::int',
'type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'size' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'extension' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'file' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
},
{
'id' => 'id',
'type' => 'type',
'name' => 'name',
'size' => 'size',
'extension' => 'extension',
'file' => 'file',
}
);
But, this is confusing as it looks like the data members are supposed to be either an integer or a string (i.e. look at the SOAP types), but why, then, are the data members for this class defined as hashes?
Clarification would be helpful.
Thanks
Ted
# obviously I haven't quoted the whol file, but rather the key components
# these I understand as private data members of the class, wth some
# syntactic sugar (ATTR) provided by the class package to automagically make
# the read accessor function (very nice)
my %id_of :ATTR
my %type_of :ATTR
my %name_of :ATTR
my %size_of :ATTR
my %extension_of :ATTR
my %file_of :ATTR
# I can't find the documentation for this function
# I know wha a factory is in OOP, having written enough of them in C++, but
# I can't find the documentation for this function, and I am especially
# interested in knowing what the arguments are supposed to be and how they're
# used.
# obviously the first appears to be an array reference to an array with field
# names, and the second two are hashes mapping the field names to hashes and
# their types
__PACKAGE__->_factory(
[ qw( id
type
name
size
extension
file
) ],
{
'id' => \%id_of,
'type' => \%type_of,
'name' => \%name_of,
'size' => \%size_of,
'extension' => \%extension_of,
'file' => \%file_of,
},
{
'id' => 'SOAP::WSDL::XSD::Typelib::Builtin::int',
'type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'size' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'extension' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'file' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
},
{
'id' => 'id',
'type' => 'type',
'name' => 'name',
'size' => 'size',
'extension' => 'extension',
'file' => 'file',
}
);
But, this is confusing as it looks like the data members are supposed to be either an integer or a string (i.e. look at the SOAP types), but why, then, are the data members for this class defined as hashes?
Clarification would be helpful.
Thanks
Ted