A role (also rôle or social role) is a set of connected behaviours, rights, obligations, beliefs, and norms as conceptualized by people in a social situation. It is an expected or free or continuously changing behaviour and may have a given individual social status or social position. It is vital to both functionalist and interactionist understandings of society.
Social role posits the following about social behaviour:
The division of labour in society takes the form of the interaction among heterogeneous specialised positions, we call roles.
Social roles included appropriate and permitted forms of behaviour, guided by social norms, which are commonly known and hence determine the expectations for appropriate behaviour in these roles.
Roles are occupied by individuals, who are called actors.
Traits both provide a set of methods that implement behaviour to a class and require that the class implement a set of methods that parameterize the provided behaviour.
For inter-object communication and sharing, traits are somewhat between an object-oriented protocol (interface) and a mixin. An interface may define one or more behaviors via method signatures, while a trait defines behaviors via full method definitions: i.e., it includes the body of the methods. In contrast, mixins include full method definitions and may also carry state through member variable, while traits usually don't.
Hence an object defined as a trait is created as the composition of methods, which can be used by other classes without requiring multiple inheritance. In case of a naming collision, when more than one trait to be used by a class has a method with the same name, the programmer must explicitly disambiguate which one of those methods will be used in the class; thus manually solving the diamond problem of multiple inheritance. This is different from other composition methods in object-oriented programming, where conflicting names are automatically resolved by scoping rules.
A character (or fictional character) is a person in a narrativework of art (such as a novel, play, television series or film). Derived from the ancient Greek word χαρακτήρ, the English word dates from the Restoration, although it became widely used after its appearance in Tom Jones in 1749. From this, the sense of "a part played by an actor" developed. Character, particularly when enacted by an actor in the theatre or cinema, involves "the illusion of being a human person." In literature, characters guide readers through their stories, helping them to understand plots and ponder themes. Since the end of the 18th century, the phrase "in character" has been used to describe an effective impersonation by an actor. Since the 19th century, the art of creating characters, as practiced by actors or writers, has been called characterisation.