Polygon - A simple demo for a one-to-many association (/examples).


Class-Classgen-classgen documentation  | view source Contained in the Class-Classgen-classgen distribution.

Index


NAME

Top

Polygon - A simple demo for a one-to-many association (/examples).

VERSION

Top

1.00

SYNOPSIS

Top

DESCRIPTION

Top

This example is taken from Rumbaughs book, chapter 3.

A Polygon consist of at least 3 Points (many). In this simple demo there is no checking on the minimum number of Points implemented.

The purpose is to show, how the one-to-many direction could be implemented in Perl. It turns out that there is no need to have an explicit variable $a_has, like in the one-to-one case (cf ../one-to-one).

Instead, the internal list @points takes this functionality. Each index of this array is a unique identifier of an individual Point-instance. See Polygon->add() for details.

You may think of further extensions of this simple Polygon class. E.g. the Polygon could have a name. It could calculate its perimeter, area etc.

ENVIRONMENT

Top

DIAGNOSTICS

Top

BUGS

Top

FILES

Top

SEE ALSO

Top

	perldoc classgen
	perldoc many
	perldoc Point

AUTHOR

Top

Name: Michael Schlueter

email: mschlue@cpan.org

COPYRIGHT

Top


Class-Classgen-classgen documentation  | view source Contained in the Class-Classgen-classgen distribution.