Role-oriented programming as a form of
computer programming aims at expressing things in terms that are analogous to human
conceptual understanding of the
world. This should make programs easier to understand and maintain.
The main idea of role-oriented programming is that humans think in terms of
roles. This claim is often backed up by examples of
social relations. For example, a student attending a class and the same student at a party are the same person, yet that person plays two different roles. In particular, the interactions of this person with the outside world depend on his current role. The roles typically share features, e.g., the intrinsic properties of being a person. This sharing of properties is often handled by the
delegation
Delegation is the assignment of authority to another person (normally from a manager to a subordinate) to carry out specific activities. It is the process of distributing and entrusting work to another person,Schermerhorn, J., Davidson, P., Poole ...
mechanism.
In the older literature and in the field of
databases, it seems that there has been little consideration for the context in which roles interplay with each other. Such a context is being established in newer role- and
aspect-oriented programming languages such as
Object Teams
Object may refer to:
General meanings
* Object (philosophy), a thing, being, or concept
** Object (abstract), an object which does not exist at any particular time or place
** Physical object, an identifiable collection of matter
* Goal, an a ...
. Compare the use of "role" as "a set of software programs (services) that enable a server to perform specific functions for users or computers on the network" in
Windows Server jargon.
Many researchers have argued the advantages of roles in
modeling and implementation. Roles allow objects to evolve over time, they enable independent and
concurrently existing views (interfaces) of the object, explicating the different contexts of the object, and
separating concerns. Generally roles are a natural element of human daily concept-forming. Roles in programming languages enable objects to have changing interfaces, as we see in
real life - things change over time, are used differently in different contexts, etc.
Authors of role literature
Barbara PerniciBruce Wallace*
Charles Bachman
Friedrich SteimannKasper B. GraversenKasper Østerbye*
Trygve Reenskaug
Thomas Kühn
Programming languages with explicit support for roles
*
JavaScript Delegation - Functions as Roles (Traits and Mixins)
Object Teams*
Perl (Moose)
*
Raku
powerJavaSCala ROLes Language
See also
*
Aspect-oriented programming
*
Data, context and interaction
*
Object Oriented Role Analysis Method
*
Object-role modeling
*
Subject (programming)
*
Subject-oriented programming
In computing, subject-oriented programming is an object-oriented software paradigm in which the state (fields) and behavior (methods) of objects are not seen as intrinsic to the objects themselves, but are provided by various subjective perceptio ...
*
Traits (computer science)
References
External links
Adaptive Plug-and-Play Components for Evolutionary Software Development by Mira Mezini and Karl Lieberherr
Overview and taxonomy of Role languagesROPE: Role Oriented Programming Environment for Multiagent Systems
{{compu-prog-stub
Object-based programming languages
Programming paradigms