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


Class-Classgen-classgen documentation Contained in the Class-Classgen-classgen distribution.

Index


Code Index:

NAME

Top

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

VERSION

Top

1.00

SYNOPSIS

Top

DESCRIPTION

Top

Points will be used by Polygons. Point-instances can retrieve their bolonging Polygon-instance via the $a_belongs_to internal variable. They can even start functions of the Polygon-class via this association.

ENVIRONMENT

Top

DIAGNOSTICS

Top

BUGS

Top

FILES

Top

SEE ALSO

Top

	perldoc classgen
	perldoc many
	perldoc Polygon

AUTHOR

Top

Name: Michael Schlueter

email: mschlue@cpan.org

COPYRIGHT

Top


Class-Classgen-classgen documentation Contained in the Class-Classgen-classgen distribution.

# --- Generated by classgen 3.03 on Fre Dez 29 21:56:41 MET 2000 ---

$VERSION=1.00;
	package Point;
;
	require 'Point_gs.pm';

sub new {
	my ($self) = @_;

	# instance-variables:
	my $x;	# coordinate
	my $y;	# coordinate
	my $a_belongs_to;	# a 'belong to' association

	$self=bless {
		_x		=>	$x,
		_y		=>	$y,
		_a_belongs_to		=>	$a_belongs_to,
	}, ref($self)||$self;
	#$self->inherit_from($self->your_base::new());	# adapt when inheriting
	return $self;
}

# --- methods specific for this class ---------------------

sub specific {
	my ($self) = @_;
}

# --- inheritance methode -----------------------------------

sub inherit_from {
	my ($self, $base_blessed) = @_;
	my @l = keys %$base_blessed;
	foreach (@l) {
		$self->{$_} = $base_blessed->{$_};
	}
}

1;

__END__