பல்லுருத்தோற்றம் (கணிப்பொறி அறிவியல்)
{{translate}}
 [[பொருள் நோக்கு நிரலாக்கம்|பொருள் நோக்கு நிரலாக்கத்தில்]], '''பல்லுருவாக்கம்''' (''Polymorphism'') என்பது ஒரு வகுப்பின் செயலிகளை, மாறிகளை, அல்லது பொருட்களை அந்த வகுப்பின் subclasses தமது தேவைகளுக்கு ஏற்றமாதிரி நிறைவேற்ற முடியும் என்ற கூற்றாகும்.
 
 == எடுத்துக்காட்டுக்கள் ==
 === பி.எச்.பி ===
 &lt;syntaxhighlight lang=php&gt;
 &lt;?php
 
 interface IAnimal
 {
     function getName();
     function talk();
 }
 
 abstract class AnimalBase implements IAnimal
 {
     protected $name;
 
     public function __construct($name)
     {
         $this-&gt;name = $name;
     }
 
     public function getName()
     {
         return $this-&gt;name;
     }
 }
 
 class Cat extends AnimalBase
 {
 
     public function talk()
     {
         return &quot;Meowww!&quot;;
     }
 }
 
 class Dog extends AnimalBase
 {
 
     public function talk()
     {
         return &quot;Arf! Arf!&quot;;
     }
 }
 
 $animals = array(
     new Cat(&quot;Missy&quot;),
     new Cat(&quot;Mr. Mistoffelees&quot;),
     new Dog(&quot;Lassie&quot;)
 );
 
 foreach ($animals as $animal) {
     echo $animal-&gt;getName() . &quot;: &quot; . $animal-&gt;talk();
 }
 
 ?&gt;
 &lt;/syntaxhighlight&gt;
 
 === பெர்ள் ===
 Polymorphism in [[பெர்ள்]] is inherently straightforward to write because of the language's use of [[Sigil (computer programming)|sigils]] and [[Reference (computer science)|references]]. This is the &lt;code&gt;Animal&lt;/code&gt; example in standard OO Perl:
 
 &lt;syntaxhighlight lang=perl&gt;
 package Animal;
 sub new {
     my ($class, $name) = @_;
     bless {name =&gt; $name}, $class;
 }
 
 package Cat;
 @ISA = &quot;Animal&quot;;
 sub talk {&quot;Meow&quot;}
 
 package Dog;
 @ISA = &quot;Animal&quot;;
 sub talk {&quot;Woof! Woof!&quot;}
 
 package main;
 my @animals = (
     Cat-&gt;new(&quot;Missy&quot;),
     Cat-&gt;new(&quot;Mr. Mistoffelees&quot;),
     Dog-&gt;new(&quot;Lassie&quot;),
 );
 for my $animal (@animals) {
     print $animal-&gt;{name} . &quot;: &quot; . $animal-&gt;talk . &quot;\n&quot;;
 }
 
 # prints the following:
 #
 # Missy: Meow
 # Mr. Mistoffelees: Meow
 # Lassie: Woof! Woof!
 &lt;/syntaxhighlight&gt;
 
 This means that Perl can also apply polymorphism to the method call. The example below is written using the &lt;code&gt;Moose&lt;/code&gt; module in order to show modern OO practises in Perl (it is not required for method polymorphism):
 
 &lt;syntaxhighlight lang=perl&gt;
 {
     package Animal;
     use Moose;
     has 'name' =&gt; ( isa =&gt; 'Str', is =&gt; 'ro' );
 }
 
 {
     package Cat;
     use Moose;
     extends 'Animal';
     sub talk  { 'Meow' }
     sub likes { 'Milk' }
 }
 
 {
     package Dog;
     use Moose;
     extends 'Animal';
     sub talk  { 'Woof! Woof!' }
     sub likes { 'Bone' }
 }
 
 my @animals = (
     Cat-&gt;new( name =&gt; 'Missy' ),
     Cat-&gt;new( name =&gt; 'Mr. Mistoffelees' ),
     Dog-&gt;new( name =&gt; 'Lassie' ),
 );
 
 for my $animal ( @animals ) {
     for my $trait qw/talk likes/ {
         print $animal-&gt;name . ': ' . $trait . ' =&gt; ' . $animal-&gt;$trait;
     }
 }
 
 # prints the following:
 #
 # Missy: talk =&gt; Meow
 # Missy: likes =&gt; Milk
 # Mr. Mistoffelees: talk =&gt; Meow
 # Mr. Mistoffelees: likes =&gt; Milk
 # Lassie: talk =&gt; Woof! Woof!
 # Lassie: likes =&gt; Bone
 &lt;/syntaxhighlight&gt;
 
 == வெளி இணைப்புகள் ==
 * [http://www.devshed.com/c/a/PHP/PHP-5-and-Polymorphism/ PHP 5 and Polymorphism] {{Webarchive|url=https://web.archive.org/web/20110615230511/http://www.devshed.com/c/a/PHP/PHP-5-and-Polymorphism/ |date=2011-06-15 }}