Object-based language

Last updated

The term object-based language may be used in a technical sense to describe any programming language that uses the idea of encapsulating state and operations inside objects . Object-based languages need not support inheritance or subtyping, but those that do are also termed object-oriented . Object-based languages that do not support inheritance or subtyping are usually not considered to be true object-oriented languages.

Examples of object-oriented languages, in rough chronological order, include Simula, Smalltalk, C++ (which object model is based on Simula's), Objective-C (which object model is based on Smalltalk's), Eiffel, Xojo (formerly REALbasic), Python, Ruby, Java, Visual Basic .NET, C#, and Fortran 2003. Examples of a language that is object-based, but not object-oriented are early versions of Ada, Visual Basic (VB), and Fortran 90. These languages all support the definition of an object as a data structure, but lack polymorphism and inheritance.

In practice, the term object-based is usually applied to those object-based languages that are not also object-oriented, although all object-oriented languages are also object-based, by definition. Instead, the terms object-based and object-oriented are normally used as mutually exclusive alternatives, rather than as categories that overlap.

Sometimes, the term object-based is applied to prototype-based programming languages, true object-oriented languages that lack classes, but in which objects instead inherit their code and data directly from other template objects. An example of a commonly used prototype-based scripting language is JavaScript.

Both object-based and object-oriented languages (whether class-based or prototype-based) may be statically type-checked. Statically checking prototype-based languages can be difficult, because these languages often allow objects to be dynamically extended with new behavior, and even to have their parent object (from which they inherit) changed, at runtime. [1] [2]

Difference between object-oriented and object-based languages
Object-oriented languageObject-based language
Object-oriented languages support all of the features of object-oriented programming (OOP): abstraction, encapsulation, inheritance, polymorphism Object-based languages support a subset of the features of OOP, such as polymorphism or inheritance.[ citation needed ]
Examples: C++, C#, Java, etc.Examples: Visual Basic (pre-.NET)[ citation needed ]

Related Research Articles

In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state and implementations of behavior.

<span class="mw-page-title-main">Programming language</span> Language for communicating instructions to a machine

A programming language is a system of notation for writing computer programs.

<span class="mw-page-title-main">Smalltalk</span> Object-oriented programming language released first in 1972

Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, and Scott Wallace.

Prototype-based programming is a style of object-oriented programming in which behaviour reuse is performed via a process of reusing existing objects that serve as prototypes. This model can also be known as prototypal, prototype-oriented,classless, or instance-based programming.

This is a "genealogy" of programming languages. Languages are categorized under the ancestor language with the strongest influence. Those ancestor languages are listed in alphabetic order. Any such categorization has a large arbitrary element, since programming languages often incorporate major ideas from multiple sources.

In computer science, an object can be a variable, a data structure, a function, or a method. As regions of memory, objects contain a value and are referenced by identifiers.

In computer science, imperative programming is a programming paradigm of software that uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program consists of commands for the computer to perform. Imperative programming focuses on describing how a program operates step by step, rather than on high-level descriptions of its expected results.

In programming language theory, subtyping is a form of type polymorphism. A subtype is a datatype that is related to another datatype by some notion of substitutability, meaning that program elements, written to operate on elements of the supertype, can also operate on elements of the subtype.

In programming language theory and type theory, polymorphism is the use of a single symbol to represent multiple different types.

In object-oriented programming languages, a mixin is a class that contains methods for use by other classes without having to be the parent class of those other classes. How those other classes gain access to the mixin's methods depends on the language. Mixins are sometimes described as being "included" rather than "inherited".

In object-oriented programming, delegation refers to evaluating a member of one object in the context of another original object. Delegation can be done explicitly, by passing the sending object to the receiving object, which can be done in any object-oriented language; or implicitly, by the member lookup rules of the language, which requires language support for the feature. Implicit delegation is the fundamental method for behavior reuse in prototype-based programming, corresponding to inheritance in class-based programming. The best-known languages that support delegation at the language level are Self, which incorporates the notion of delegation through its notion of mutable parent slots that are used upon method lookup on self calls, and JavaScript; see JavaScript delegation.

<span class="mw-page-title-main">History of programming languages</span> History of languages used to program computers

The history of programming languages spans from documentation of early mechanical computers to modern tools for software development. Early programming languages were highly specialized, relying on mathematical notation and similarly obscure syntax. Throughout the 20th century, research in compiler theory led to the creation of high-level programming languages, which use a more accessible syntax to communicate instructions.

Class-based programming, or more commonly class-orientation, is a style of object-oriented programming (OOP) in which inheritance occurs via defining classes of objects, instead of inheritance occurring via the objects alone.

In computer science, object composition and object aggregation are closely related ways to combine objects or data types into more complex ones. In conversation the distinction between composition and aggregation is often ignored. Common kinds of compositions are objects used in object-oriented programming, tagged unions, sets, sequences, and various graph structures. Object compositions relate to, but are not the same as, data structures.

In object-oriented programming, inheritance is the mechanism of basing an object or class upon another object or class, retaining similar implementation. Also defined as deriving new classes from existing ones such as super class or base class and then forming them into a hierarchy of classes. In most class-based object-oriented languages like C++, an object created through inheritance, a "child object", acquires all the properties and behaviors of the "parent object", with the exception of: constructors, destructors, overloaded operators and friend functions of the base class. Inheritance allows programmers to create classes that are built upon existing classes, to specify a new implementation while maintaining the same behaviors, to reuse code and to independently extend original software via public classes and interfaces. The relationships of objects or classes through inheritance give rise to a directed acyclic graph.

Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.

In type theory, bounded quantification refers to universal or existential quantifiers which are restricted ("bounded") to range only over the subtypes of a particular type. Bounded quantification is an interaction of parametric polymorphism with subtyping. Bounded quantification has traditionally been studied in the functional setting of System F<:, but is available in modern object-oriented languages supporting parametric polymorphism (generics) such as Java, C# and Scala.

<span class="mw-page-title-main">Object-oriented programming</span> Programming paradigm based on the concept of objects

Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code: data in the form of fields, and code in the form of procedures. In OOP, computer programs are designed by making them out of objects that interact with one another.

References

  1. Wegner, Peter (December 1987). "Dimensions of object-based language design" (PDF). In Meyrowitz, Norman (ed.). Conference proceedings on Object-oriented programming systems, languages and applications - OOPSLA '87. Vol. 22. pp. 168–182. doi:10.1145/38765.38823. ISBN   0897912470. S2CID   819420.
  2. Barbey, S.; Kempe, M.; Strohmeier, A. (1993). "Object-Oriented Programming with Ada 9X". Draft Technical Report. Swiss Federal Institute of Technology in Lausanne Software Engineering Laboratory. Retrieved 15 December 2013. Ada 83 itself is generally not considered to be object-oriented; rather, according to the terminology of Wegner [Weg 87], it is said to be object-based, since it provides only a restricted form of inheritance and it lacks polymorphism.