Top "Traits" questions

In computer programming, a trait is a collection of methods, used as a "simple conceptual model for structuring object oriented programs"

Traits vs. interfaces

I've been trying to study up on PHP lately, and I find myself getting hung up on traits. I understand …

php interface traits
How to override trait function and call it from the overridden function?

Scenario: trait A { function calc($v) { return $v+1; } } class MyClass { use A; function calc($v) { $v++; return A::calc($v); } } …

php traits
What is the advantage of using abstract classes instead of traits?

What is the advantage of using an abstract class instead of a trait (apart from performance)? It seems like abstract …

scala traits
What is a sealed trait?

Sealed classes are described in 'Programming in Scala', but sealed traits are not. Where can I find more information about …

scala sealed traits
What is the difference between self-types and trait subclasses?

A self-type for a trait A: trait B trait A { this: B => } says that "A cannot be mixed into …

scala traits self-type
Difference between Abstract Class and Trait

Possible Duplicate: Scala traits vs abstract classes What is the conceptual difference between abstract classes and traits?

scala abstract-class traits
Traits in PHP – any real world examples/best practices?

Traits have been one of the biggest additions for PHP 5.4. I know the syntax and understand the idea behind traits, …

php traits
How to overload class constructor within traits in PHP >= 5.4

In PHP 5, I can to overload constructors (and any others methods). But if I get some code like this: class …

php traits
Traits and abstract methods override in Scala

I have a base abstract class (trait). It has an abstract method foo(). It is extended and implemented by several …

scala traits
Mixing multiple traits in Scala

Quick note: Examples from the tutorial Scala for Java Refugees Part 5: Traits and Types. Suppose I have the traits Student, …

scala mixins traits