https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Trait_%28Programmierung%29 Trait (Programmierung) - Versionsgeschichte 2025-05-12T09:11:09Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.44.0-wmf.28 https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=236831700&oldid=prev Heronils: Deutsche Übersetzung hinzugefügt 2023-08-28T17:28:02Z <p>Deutsche Übersetzung hinzugefügt</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 28. August 2023, 19:28 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 1:</td> <td colspan="2" class="diff-lineno">Zeile 1:</td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Ein '''Trait''' ist ein Begriff aus der [[Objektorientierte Programmierung|objektorientierten Programmierung]] und beschreibt eine wiederverwendbare Sammlung von [[Methode (Programmierung)|Methoden]] und [[Attribut (Programmierung)|Attributen]], ähnlich einer [[Klasse_(Objektorientierung)|Klasse]]. Die Idee der Traits entspringt der [[Programmiersprache]] [[Self (Programmiersprache)|Self]] und findet mittlerweile in vielen modernen objektorientierten Sprachen Verwendung.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Ein '''Trait'''<ins style="font-weight: bold; text-decoration: none;"> (Deutsch: ''Eigenschaft'', ''Charakteristik'')</ins> ist ein Begriff aus der [[Objektorientierte Programmierung|objektorientierten Programmierung]] und beschreibt eine wiederverwendbare Sammlung von [[Methode (Programmierung)|Methoden]] und [[Attribut (Programmierung)|Attributen]], ähnlich einer [[Klasse_(Objektorientierung)|Klasse]]. Die Idee der Traits entspringt der [[Programmiersprache]] [[Self (Programmiersprache)|Self]] und findet mittlerweile in vielen modernen objektorientierten Sprachen Verwendung.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Verwendung von Traits erlaubt das horizontale Wiederverwenden einer Methodensammlung. Bei dem Prinzip der [[Mehrfachvererbung]], das einige objektorientierte Programmiersprachen anbieten, ist das gleiche Vorgehen möglich; jedoch umgehen Traits (so wie auch [[Mixin|Mixins]]) das [[Diamond-Problem]], eine speziell durch die Mehrfachvererbung hervorgerufene Beziehungsproblematik unter verschiedenen Klassen.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Verwendung von Traits erlaubt das horizontale Wiederverwenden einer Methodensammlung. Bei dem Prinzip der [[Mehrfachvererbung]], das einige objektorientierte Programmiersprachen anbieten, ist das gleiche Vorgehen möglich; jedoch umgehen Traits (so wie auch [[Mixin|Mixins]]) das [[Diamond-Problem]], eine speziell durch die Mehrfachvererbung hervorgerufene Beziehungsproblematik unter verschiedenen Klassen.</div></td> </tr> </table> Heronils https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=218756947&oldid=prev Trustable: Kleinigkeiten verbessert 2022-01-03T18:01:00Z <p>Kleinigkeiten verbessert</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 3. Januar 2022, 20:01 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 1:</td> <td colspan="2" class="diff-lineno">Zeile 1:</td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Ein '''Trait''' ist ein Begriff aus der [[Objektorientierte Programmierung|objektorientierten Programmierung]] und beschreibt eine wiederverwendbare Sammlung von [[Methode (Programmierung)|Methoden]] und [[Attribut (<del style="font-weight: bold; text-decoration: none;">Objekt</del>)|Attributen]], ähnlich einer [[Klasse_(Objektorientierung)|Klasse]]. Die Idee der Traits entspringt der [[Programmiersprache]] [[Self (Programmiersprache)|Self]] und findet mittlerweile in vielen modernen objektorientierten Sprachen Verwendung.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Ein '''Trait''' ist ein Begriff aus der [[Objektorientierte Programmierung|objektorientierten Programmierung]] und beschreibt eine wiederverwendbare Sammlung von [[Methode (Programmierung)|Methoden]] und [[Attribut (<ins style="font-weight: bold; text-decoration: none;">Programmierung</ins>)|Attributen]], ähnlich einer [[Klasse_(Objektorientierung)|Klasse]]. Die Idee der Traits entspringt der [[Programmiersprache]] [[Self (Programmiersprache)|Self]] und findet mittlerweile in vielen modernen objektorientierten Sprachen Verwendung.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Verwendung von Traits erlaubt das horizontale Wiederverwenden einer Methodensammlung. Bei dem Prinzip der [[Mehrfachvererbung]], das einige objektorientierte Programmiersprachen anbieten, ist das gleiche Vorgehen möglich; jedoch umgehen Traits (so wie auch [[Mixin|Mixins]]) das [[Diamond-Problem]], eine speziell durch die Mehrfachvererbung hervorgerufene Beziehungsproblematik unter verschiedenen Klassen.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Verwendung von Traits erlaubt das horizontale Wiederverwenden einer Methodensammlung. Bei dem Prinzip der [[Mehrfachvererbung]], das einige objektorientierte Programmiersprachen anbieten, ist das gleiche Vorgehen möglich; jedoch umgehen Traits (so wie auch [[Mixin|Mixins]]) das [[Diamond-Problem]], eine speziell durch die Mehrfachvererbung hervorgerufene Beziehungsproblematik unter verschiedenen Klassen.</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 53:</td> <td colspan="2" class="diff-lineno">Zeile 53:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Programmiersprachen, die Traits unterstützen ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Programmiersprachen, die Traits unterstützen ==</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Curl (Programmiersprache)|Curl]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Curl (Programmiersprache)|Curl]]</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* [[Fortress (Programmiersprache)|Fortress]]&lt;ref&gt;[http://www.cs.cmu.edu/~aldrich/FOOL/FOOLWOOD07/Allen-slides.pdf Traits in Fortress] (<del style="font-weight: bold; text-decoration: none;">engl.</del>, PDF-Datei; 2,5&amp;nbsp;MB)&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[Fortress (Programmiersprache)|Fortress]]&lt;ref&gt;[http://www.cs.cmu.edu/~aldrich/FOOL/FOOLWOOD07/Allen-slides.pdf Traits in Fortress] (<ins style="font-weight: bold; text-decoration: none;">englisch</ins>, PDF-Datei; 2,5&amp;nbsp;MB)&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Groovy|Groovy (ab Release 2.3)]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Groovy|Groovy (ab Release 2.3)]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Haxe (Programmiersprache)|Haxe]] (mit der Zusatzbibliothek Composure möglich)&lt;ref&gt;[http://www.tbyrne.org/introducing-composure-for-haxe-with-dependency-injection Introducing Composure for Haxe (with Dependency Injection)]&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Haxe (Programmiersprache)|Haxe]] (mit der Zusatzbibliothek Composure möglich)&lt;ref&gt;[http://www.tbyrne.org/introducing-composure-for-haxe-with-dependency-injection Introducing Composure for Haxe (with Dependency Injection)]&lt;/ref&gt;</div></td> </tr> </table> Trustable https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=216450046&oldid=prev Elutz: /* Traits als besondere Variante der Mixins */ -BKL (passte nicht) 2021-10-17T16:03:37Z <p><span class="autocomment">Traits als besondere Variante der Mixins: </span> -BKL (passte nicht)</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 17. Oktober 2021, 18:03 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 4:</td> <td colspan="2" class="diff-lineno">Zeile 4:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Traits als besondere Variante der Mixins ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Traits als besondere Variante der Mixins ==</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Traits sind bei der <del style="font-weight: bold; text-decoration: none;">[[</del>Einbindung<del style="font-weight: bold; text-decoration: none;">]]</del> in andere Klassen viel flexibler als [[Mixin]]s:&lt;ref&gt;[http://www.kingcrunch.de/blog/2011/08/01/php5-4-traits-aka-horizontal-reuse/ kingcrunch.de: PHP5.4: Traits aka „Horizontal Reuse“]&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Traits sind bei der Einbindung in andere Klassen viel flexibler als [[Mixin]]s:&lt;ref&gt;[http://www.kingcrunch.de/blog/2011/08/01/php5-4-traits-aka-horizontal-reuse/ kingcrunch.de: PHP5.4: Traits aka „Horizontal Reuse“]&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* einzelne Methoden eines Traits lassen sich ausschließen oder durch eine andere ersetzen</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* einzelne Methoden eines Traits lassen sich ausschließen oder durch eine andere ersetzen</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* mehrere Traits können in eine Klasse inkludiert werden, wobei sich Namenskonflikte (d.&amp;nbsp;h. gleichbenannte Methoden) mit Hilfe von [[Aliasing|Aliasen]] lösen lassen.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* mehrere Traits können in eine Klasse inkludiert werden, wobei sich Namenskonflikte (d.&amp;nbsp;h. gleichbenannte Methoden) mit Hilfe von [[Aliasing|Aliasen]] lösen lassen.</div></td> </tr> </table> Elutz https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=203483346&oldid=prev Acky69: /* Traits als besondere Variante der Mixins */ straffer, Doppel-Link raus 2020-09-07T17:31:34Z <p><span class="autocomment">Traits als besondere Variante der Mixins: </span> straffer, Doppel-Link raus</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 7. September 2020, 19:31 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 4:</td> <td colspan="2" class="diff-lineno">Zeile 4:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Traits als besondere Variante der Mixins ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Traits als besondere Variante der Mixins ==</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Im</del> <del style="font-weight: bold; text-decoration: none;">Gegensatz</del> <del style="font-weight: bold; text-decoration: none;">zu</del> <del style="font-weight: bold; text-decoration: none;">einem</del> [[<del style="font-weight: bold; text-decoration: none;">Mixin</del>]]<del style="font-weight: bold; text-decoration: none;"> sind Traits bei der Einbindung</del> in andere Klassen<del style="font-weight: bold; text-decoration: none;"> sehr</del> viel flexibler<del style="font-weight: bold; text-decoration: none;">.</del> <del style="font-weight: bold; text-decoration: none;">So lassen sich einzelne Methoden eines Traits ausschließen oder durch eine andere ersetzen. Auch können mehrere Traits in eine Klasse inkludiert werden, wobei sich Namenskonflikte mit Hilfe von</del> [[<del style="font-weight: bold; text-decoration: none;">Aliasing|Aliasen]] lösen lassen, um die Verwendung gleichbenannter Methoden zu garantieren. Ein Trait kann dabei auch Methoden benutzen, die nur Teil der inkludierenden Klasse sind und nicht im Trait selbst definiert wurden. Gegenüber einem </del>Mixin<del style="font-weight: bold; text-decoration: none;"> bietet ein Trait zudem die Möglichkeit, auch [[Attribut (Objekt)|Klassenattribute</del>]]<del style="font-weight: bold; text-decoration: none;"> zu definieren.</del>&lt;ref&gt;[http://www.kingcrunch.de/blog/2011/08/01/php5-4-traits-aka-horizontal-reuse/ kingcrunch.de: PHP5.4: Traits aka „Horizontal Reuse“]&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Traits</ins> <ins style="font-weight: bold; text-decoration: none;">sind</ins> <ins style="font-weight: bold; text-decoration: none;">bei</ins> <ins style="font-weight: bold; text-decoration: none;">der</ins> [[<ins style="font-weight: bold; text-decoration: none;">Einbindung</ins>]] in andere Klassen viel flexibler <ins style="font-weight: bold; text-decoration: none;">als</ins> [[Mixin]]<ins style="font-weight: bold; text-decoration: none;">s:</ins>&lt;ref&gt;[http://www.kingcrunch.de/blog/2011/08/01/php5-4-traits-aka-horizontal-reuse/ kingcrunch.de: PHP5.4: Traits aka „Horizontal Reuse“]&lt;/ref&gt;</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* einzelne Methoden eines Traits lassen sich ausschließen oder durch eine andere ersetzen</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* mehrere Traits können in eine Klasse inkludiert werden, wobei sich Namenskonflikte (d.&amp;nbsp;h. gleichbenannte Methoden) mit Hilfe von [[Aliasing|Aliasen]] lösen lassen.</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* ein Trait kann Methoden benutzen, die nicht in ihm selbst definiert wurden, sondern in der inkludierenden Klasse.</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* ein Trait bietet die Möglichkeit, auch Klassenattribute zu definieren.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Beispiele ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Beispiele ==</div></td> </tr> </table> Acky69 https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=197831727&oldid=prev Ranunculus: /* Programmiersprachen, die Traits unterstützen */ Perl 6 -> Raku 2020-03-17T06:21:46Z <p><span class="autocomment">Programmiersprachen, die Traits unterstützen: </span> Perl 6 -&gt; Raku</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 17. März 2020, 08:21 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 55:</td> <td colspan="2" class="diff-lineno">Zeile 55:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Kotlin (Programmiersprache)|Kotlin]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Kotlin (Programmiersprache)|Kotlin]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)|Perl 5]] (''roles'', durch das Modul Moose)&lt;ref&gt;[http://metacpan.org/module/Moose::Role Moose::Role Dokumentation]&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)|Perl 5]] (''roles'', durch das Modul Moose)&lt;ref&gt;[http://metacpan.org/module/Moose::Role Moose::Role Dokumentation]&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_3_0_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_1_0_lhs"></a>* [[<del style="font-weight: bold; text-decoration: none;">Perl</del> (Programmiersprache)<del style="font-weight: bold; text-decoration: none;">#Perl 6</del>|<del style="font-weight: bold; text-decoration: none;">Perl 6</del>]] (auch dort ''roles'' genannt)&lt;ref&gt;{{Webarchiv|url=http://chris.prather.org/traits-vs-roles.md.html |wayback=20110921112151 |text=Perl 6: ''roles'' und ''traits'' |archiv-bot=2019-05-19 04:21:15 InternetArchiveBot }}&lt;/ref&gt;</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Pharo (Programmiersprache)|Pharo Smalltalk]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Pharo (Programmiersprache)|Pharo Smalltalk]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Python (Programmiersprache)|Python]] (z.&amp;nbsp;B. durch das Modul Traits&lt;ref&gt;[http://pypi.python.org/pypi/traits PyPI: traits 4.4.0]&lt;/ref&gt;)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Python (Programmiersprache)|Python]] (z.&amp;nbsp;B. durch das Modul Traits&lt;ref&gt;[http://pypi.python.org/pypi/traits PyPI: traits 4.4.0]&lt;/ref&gt;)</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_1_0_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_3_0_rhs"></a>* [[<ins style="font-weight: bold; text-decoration: none;">Raku</ins> (Programmiersprache)|<ins style="font-weight: bold; text-decoration: none;">Raku</ins>]] (auch dort ''roles'' genannt)&lt;ref&gt;{{Webarchiv|url=http://chris.prather.org/traits-vs-roles.md.html |wayback=20110921112151 |text=Perl 6: ''roles'' und ''traits'' |archiv-bot=2019-05-19 04:21:15 InternetArchiveBot }}&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[https://doc.rust-lang.org/reference/items/traits.html Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[https://doc.rust-lang.org/reference/items/traits.html Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Scala (Programmiersprache)|Scala]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Scala (Programmiersprache)|Scala]]</div></td> </tr> </table> Ranunculus https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=189714306&oldid=prev 217.88.47.142 am 20. Juni 2019 um 13:34 Uhr 2019-06-20T13:34:05Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 20. Juni 2019, 15:34 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 59:</td> <td colspan="2" class="diff-lineno">Zeile 59:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Python (Programmiersprache)|Python]] (z.&amp;nbsp;B. durch das Modul Traits&lt;ref&gt;[http://pypi.python.org/pypi/traits PyPI: traits 4.4.0]&lt;/ref&gt;)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Python (Programmiersprache)|Python]] (z.&amp;nbsp;B. durch das Modul Traits&lt;ref&gt;[http://pypi.python.org/pypi/traits PyPI: traits 4.4.0]&lt;/ref&gt;)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[<del style="font-weight: bold; text-decoration: none;">http</del>://doc.rust-lang.org/reference.html<del style="font-weight: bold; text-decoration: none;">#traits</del> Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[<ins style="font-weight: bold; text-decoration: none;">https</ins>://doc.rust-lang.org/reference<ins style="font-weight: bold; text-decoration: none;">/items/traits</ins>.html Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Scala (Programmiersprache)|Scala]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Scala (Programmiersprache)|Scala]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Self (Programmiersprache)|Self]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Self (Programmiersprache)|Self]]</div></td> </tr> </table> 217.88.47.142 https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=188720286&oldid=prev InternetArchiveBot: InternetArchiveBot hat 1 Archivlink(s) ergänzt und 0 Link(s) als defekt/tot markiert. #IABot (v2.0beta14) 2019-05-19T04:21:16Z <p><a href="/wiki/Benutzer:InternetArchiveBot" title="Benutzer:InternetArchiveBot">InternetArchiveBot</a> hat 1 Archivlink(s) ergänzt und 0 Link(s) als defekt/tot markiert. #IABot (v2.0beta14)</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 19. Mai 2019, 06:21 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 55:</td> <td colspan="2" class="diff-lineno">Zeile 55:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Kotlin (Programmiersprache)|Kotlin]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Kotlin (Programmiersprache)|Kotlin]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)|Perl 5]] (''roles'', durch das Modul Moose)&lt;ref&gt;[http://metacpan.org/module/Moose::Role Moose::Role Dokumentation]&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)|Perl 5]] (''roles'', durch das Modul Moose)&lt;ref&gt;[http://metacpan.org/module/Moose::Role Moose::Role Dokumentation]&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)#Perl 6|Perl 6]] (auch dort ''roles'' genannt)&lt;ref&gt;<del style="font-weight: bold; text-decoration: none;">[</del>http://chris.prather.org/traits-vs-roles.md.html Perl 6: ''roles'' und ''traits''<del style="font-weight: bold; text-decoration: none;">]</del>&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)#Perl 6|Perl 6]] (auch dort ''roles'' genannt)&lt;ref&gt;<ins style="font-weight: bold; text-decoration: none;">{{Webarchiv|url=</ins>http://chris.prather.org/traits-vs-roles.md.html <ins style="font-weight: bold; text-decoration: none;">|wayback=20110921112151 |text=</ins>Perl 6: ''roles'' und ''traits''<ins style="font-weight: bold; text-decoration: none;"> |archiv-bot=2019-05-19 04:21:15 InternetArchiveBot }}</ins>&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Pharo (Programmiersprache)|Pharo Smalltalk]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Pharo (Programmiersprache)|Pharo Smalltalk]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> </tr> </table> InternetArchiveBot https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=169685973&oldid=prev Eriom: WP-interne Verlinkung ... 2017-10-04T19:38:58Z <p>WP-interne Verlinkung ...</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 4. Oktober 2017, 21:38 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 1:</td> <td colspan="2" class="diff-lineno">Zeile 1:</td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Ein '''Trait''' ist ein Begriff aus der [[Objektorientierte Programmierung|objektorientierten Programmierung]] und beschreibt eine wiederverwendbare Sammlung von [[Methode (Programmierung)|Methoden]] und [[Attribut (Objekt)|Attributen]], ähnlich einer Klasse. Die Idee der Traits entspringt der [[Programmiersprache]] [[Self (Programmiersprache)|Self]] und findet mittlerweile in vielen modernen objektorientierten Sprachen Verwendung.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Ein '''Trait''' ist ein Begriff aus der [[Objektorientierte Programmierung|objektorientierten Programmierung]] und beschreibt eine wiederverwendbare Sammlung von [[Methode (Programmierung)|Methoden]] und [[Attribut (Objekt)|Attributen]], ähnlich einer <ins style="font-weight: bold; text-decoration: none;">[[Klasse_(Objektorientierung)|</ins>Klasse<ins style="font-weight: bold; text-decoration: none;">]]</ins>. Die Idee der Traits entspringt der [[Programmiersprache]] [[Self (Programmiersprache)|Self]] und findet mittlerweile in vielen modernen objektorientierten Sprachen Verwendung.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Verwendung von Traits erlaubt das horizontale Wiederverwenden einer Methodensammlung. Bei dem Prinzip der [[Mehrfachvererbung]], das einige objektorientierte Programmiersprachen anbieten, ist das gleiche Vorgehen möglich; jedoch umgehen Traits (so wie auch [[Mixin|Mixins]]) das [[Diamond-Problem]], eine speziell durch die Mehrfachvererbung hervorgerufene Beziehungsproblematik unter verschiedenen Klassen.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Die Verwendung von Traits erlaubt das horizontale Wiederverwenden einer Methodensammlung. Bei dem Prinzip der [[Mehrfachvererbung]], das einige objektorientierte Programmiersprachen anbieten, ist das gleiche Vorgehen möglich; jedoch umgehen Traits (so wie auch [[Mixin|Mixins]]) das [[Diamond-Problem]], eine speziell durch die Mehrfachvererbung hervorgerufene Beziehungsproblematik unter verschiedenen Klassen.</div></td> </tr> </table> Eriom https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=162985034&oldid=prev SemanticMan: Sortierung der Programmiersprachen und Kotlin hinzugefügt. 2017-02-24T23:41:33Z <p>Sortierung der Programmiersprachen und Kotlin hinzugefügt.</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 25. Februar 2017, 01:41 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 52:</td> <td colspan="2" class="diff-lineno">Zeile 52:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Groovy|Groovy (ab Release 2.3)]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Groovy|Groovy (ab Release 2.3)]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Haxe (Programmiersprache)|Haxe]] (mit der Zusatzbibliothek Composure möglich)&lt;ref&gt;[http://www.tbyrne.org/introducing-composure-for-haxe-with-dependency-injection Introducing Composure for Haxe (with Dependency Injection)]&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Haxe (Programmiersprache)|Haxe]] (mit der Zusatzbibliothek Composure möglich)&lt;ref&gt;[http://www.tbyrne.org/introducing-composure-for-haxe-with-dependency-injection Introducing Composure for Haxe (with Dependency Injection)]&lt;/ref&gt;</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_3_0_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_1_0_rhs"></a>* [[JavaScript#Delegationsprinzipien|JavaScript Delegation – Funktionsobjekte als Rollen (Traits und Mixins)]]</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_5_0_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_1_1_rhs"></a>* [[<ins style="font-weight: bold; text-decoration: none;">Kotlin</ins> (Programmiersprache)|<ins style="font-weight: bold; text-decoration: none;">Kotlin</ins>]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)|Perl 5]] (''roles'', durch das Modul Moose)&lt;ref&gt;[http://metacpan.org/module/Moose::Role Moose::Role Dokumentation]&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)|Perl 5]] (''roles'', durch das Modul Moose)&lt;ref&gt;[http://metacpan.org/module/Moose::Role Moose::Role Dokumentation]&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)#Perl 6|Perl 6]] (auch dort ''roles'' genannt)&lt;ref&gt;[http://chris.prather.org/traits-vs-roles.md.html Perl 6: ''roles'' und ''traits'']&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Perl (Programmiersprache)#Perl 6|Perl 6]] (auch dort ''roles'' genannt)&lt;ref&gt;[http://chris.prather.org/traits-vs-roles.md.html Perl 6: ''roles'' und ''traits'']&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_1_0_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_3_0_lhs"></a>* [[JavaScript#Delegationsprinzipien|JavaScript Delegation – Funktionsobjekte als Rollen (Traits und Mixins)]]</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Pharo (Programmiersprache)|Pharo Smalltalk]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Pharo (Programmiersprache)|Pharo Smalltalk]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[PHP]] ab Version 5.4</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Python (Programmiersprache)|Python]] (z.&amp;nbsp;B. durch das Modul Traits&lt;ref&gt;[http://pypi.python.org/pypi/traits PyPI: traits 4.4.0]&lt;/ref&gt;)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Python (Programmiersprache)|Python]] (z.&amp;nbsp;B. durch das Modul Traits&lt;ref&gt;[http://pypi.python.org/pypi/traits PyPI: traits 4.4.0]&lt;/ref&gt;)</div></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_1_1_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_5_0_lhs"></a>* [[<del style="font-weight: bold; text-decoration: none;">Self</del> (Programmiersprache)|<del style="font-weight: bold; text-decoration: none;">Self</del>]]</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_7_0_rhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_5_1_lhs"></a>* [[Scala (Programmiersprache)|Scala]]</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[http://doc.rust-lang.org/reference.html#traits Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[http://doc.rust-lang.org/reference.html#traits Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_5_1_lhs">&#x26AB;</a></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_7_0_rhs"></a>* [[Scala (Programmiersprache)|Scala]]</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[Self (Programmiersprache)|Self]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Weblinks ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Weblinks ==</div></td> </tr> </table> SemanticMan https://de.wikipedia.org/w/index.php?title=Trait_(Programmierung)&diff=144228222&oldid=prev Hoodie~dewiki: /* Programmiersprachen, die Traits unterstützen */ 2015-07-21T09:33:51Z <p><span class="autocomment">Programmiersprachen, die Traits unterstützen</span></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. Juli 2015, 11:33 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 60:</td> <td colspan="2" class="diff-lineno">Zeile 60:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Self (Programmiersprache)|Self]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Self (Programmiersprache)|Self]]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Scala (Programmiersprache)|Scala]]</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* [[Scala (Programmiersprache)|Scala]]</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[http://<del style="font-weight: bold; text-decoration: none;">static</del>.rust-lang.org/<del style="font-weight: bold; text-decoration: none;">doc/master/rust</del>.html#traits Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* [[Rust (Programmiersprache)|Rust]]&lt;ref&gt;[http://<ins style="font-weight: bold; text-decoration: none;">doc</ins>.rust-lang.org/<ins style="font-weight: bold; text-decoration: none;">reference</ins>.html#traits Rust Reference Manual: ''Traits'']&lt;/ref&gt;</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Weblinks ==</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Weblinks ==</div></td> </tr> </table> Hoodie~dewiki