Delegation is the action and effect of delegating (giving a person or group the faculties and powers necessary to represent another or others). One who represents another is known as a delegate: his position and his office are called a delegation.
The term is also used to name the team or working group that represents a community or a country. For example: “The Chilean delegation arrived on African soil after a fourteen-hour flight”, “A Chinese delegation met with the Uruguayan president to analyze a possible bilateral trade agreement”, “The governor was very angry with the delegation from the North American company that tried to violate internal regulations”.
Delegation is the act and result of delegating.
- Abbreviationfinder: Find definitions of English word – Conference. Commonly used abbreviations related to word are also included.
Delegation in administrative law
In the field of administrative law, the delegation is the transfer from a higher body to a lower one of the exercise of a competence, although the delegator maintains ownership of it.
The delegation is specified through an administrative act and can be revoked by the delegator.
The concept in Mexico and Spain
In Mexico, the delegation is a political and administrative division within a city. Mexico City, for example, is divided into sixteen delegations that, in turn, are subdivided into neighborhoods and neighborhoods.
In Spain, meanwhile, there is talk of Government Delegations to refer to State bodies of a political nature.
The concept of delegation is used in computing.
It is known by the name of delegation to a mechanism of object-oriented programming that consists of entrusting a certain functionality from one class to another. It differs from inheritance by its selective reuse.
Let’s see a practical example: a class A has a method to calculate the area of any given geometric figure; however, it does not have the tools to perform the calculations by itself but, once the figure has been analyzed, it delegates the action to the appropriate class through a call to the relevant method, to finally return the result.
Despite being a widely known practice, few programming languages implement delegation as an alternative model to static inheritance. Among the languages that do offer this possibility is Self, born in the late 1980s.
The multicast delegate concept refers to a delegate that points to multiple methods. It is a mechanism that offers the possibility of executing more than one method, similar to the case of surface calculation exposed above.
Advantages of the method
The use of delegations is a good practice as an alternative to inheritance whenever upward conversions are not needed (converting an object to a type of a lower hierarchy, for example: an object of class Shape to class Square ). Experts tend to recommend it over inheritance in most cases, unless it’s too complicated.
When working with a language that does not directly support delegation, it is possible to emulate it through class composition (housing an object from a different class in a class and making it private, so that the user cannot see its original interface but that of the class that contains it) to delegate certain tasks to the objects that are capable of solving them.
It is worth mentioning that the use of a delegate method is not always done through one with the same number and type of parameters; for example: in a class M there is a Calculate Area method that receives a series of parameters, among which is FigureType ; if you want to use it from a class C, which only operates with squares, then said class can have a method with a name similar to the original, but that does not expect the specification of the type of figure, and that passes to the method of class M always the same value for that parameter (that is, “square”).