Search This Blog

Monday, June 4, 2018

Voyager 2

From Wikipedia, the free encyclopedia
Voyager 2
Model of a small-bodied spacecraft with a large, central dish and many arms and antennas extending from it
Model of the Voyager spacecraft design

Mission type Planetary exploration
Operator NASA / JPL[1]
COSPAR ID 1977-076A[2]
SATCAT no. 10271[3]
Website voyager.jpl.nasa.gov
Mission duration 40 years, 9 months and 13 days elapsed
Planetary mission: 12 years, 1 month, 12 days
Interstellar mission: 28 years and 8 months elapsed (continuing)

Spacecraft properties
Manufacturer Jet Propulsion Laboratory
Launch mass 825.5 kilograms (1,820 lb)
Power 420 watts

Start of mission
Launch date August 20, 1977, 14:29:00 UTC
Rocket Titan IIIE
Launch site Cape Canaveral LC-41

Flyby of Jupiter
Closest approach July 9, 1979, 22:29:00 UTC
Distance 570,000 kilometers (350,000 mi)
Flyby of Saturn
Closest approach August 25, 1981, 03:24:05 UTC
Distance 101,000 km (63,000 mi)
Flyby of Uranus
Closest approach January 24, 1986, 17:59:47 UTC
Distance 81,500 km (50,600 mi)
Flyby of Neptune
Closest approach August 25, 1989, 03:56:36 UTC
Distance 4,951 km (3,076 mi)


Voyager 2 is a space probe launched by NASA on August 20, 1977, to study the outer planets. Part of the Voyager program, it was launched 16 days before its twin, Voyager 1, on a trajectory that took longer to reach Jupiter and Saturn but enabled further encounters with Uranus and Neptune.[4] It is the only spacecraft to have visited either of the ice giants.

Its primary mission ended with the exploration of the Neptunian system on October 2, 1989, after having visited the Uranian system in 1986, the Saturnian system in 1981, and the Jovian system in 1979. Voyager 2 is now in its extended mission to study the outer reaches of the Solar System and has been operating for 40 years, 9 months and 13 days as of June 2, 2018. It remains in contact through the Deep Space Network.[5]

At a distance of 117 AU (1.75×1010 km) from the Sun as of March 17, 2018,[6] Voyager 2 is the fourth of five spacecraft to achieve the escape velocity that will allow them to leave the Solar System. The probe was moving at a velocity of 15.4 km/s (55,000 km/h) relative to the Sun as of December 2014 and is traveling through the heliosheath.[6][7] Upon reaching interstellar space, Voyager 2 is expected to provide the first direct measurements of the density and temperature of the interstellar plasma.[8]

Mission History

History

In the early space age, it was realized that a coincidental alignment of the outer planets would occur in the late 1970s and enable a single probe to visit Jupiter, Saturn, Uranus, and Neptune by taking advantage of the then-new technique of gravity assists. NASA began work on a Grand Tour, which evolved into a massive project involving two groups of two probes each, with one group visiting Jupiter, Saturn, and Pluto and the other Jupiter, Uranus, and Neptune. The spacecraft would be designed with redundant systems to ensure survival through the entire tour. By 1972 the mission was scaled back and replaced with two Mariner-derived spacecraft, the Mariner Jupiter-Saturn probes. To keep apparent lifetime program costs low, the mission would include only flybys of Jupiter and Saturn, but keep the Grand Tour option open.[4]:263 As the program progressed, the name was changed to Voyager.[9]

The primary mission of Voyager 1 was to explore Jupiter, Saturn, and Saturn's moon, Titan. Voyager 2 was also to explore Jupiter and Saturn, but on a trajectory that would have option of continuing on to Uranus and Neptune, or being redirected to Titan as a backup for Voyager 1. Upon successful completion of Voyager 1's objectives, Voyager 2 would get a mission extension to send the probe on towards Uranus and Neptune.[4]

Spacecraft design

Constructed by the Jet Propulsion Laboratory (JPL), Voyager 2 included 16 hydrazine thrusters, three-axis stabilization, gyroscopes and celestial referencing instruments (Sun sensor/Canopus Star Tracker) to maintain pointing of the high-gain antenna toward Earth. Collectively these instruments are part of the Attitude and Articulation Control Subsystem (AACS) along with redundant units of most instruments and 8 backup thrusters. The spacecraft also included 11 scientific instruments to study celestial objects as it traveled through space.[10]

Communications

Built with the intent for eventual interstellar travel, Voyager 2 included a large, 3.7 m (12 ft) parabolic, high-gain antenna (see diagram) to transceive data via the Deep Space Network on the Earth. Communications are conducted over the S-band (about 13 cm wavelength) and X-band (about 3.6 cm wavelength) providing data rates as high as 115.2 kilobits per second at the distance of Jupiter, and then ever-decreasing as the distance increased, because of the inverse-square law. When the spacecraft is unable to communicate with Earth, the Digital Tape Recorder (DTR) can record about 64 kilobytes of data for transmission at another time.[11]

Power

The spacecraft was equipped with 3 Multihundred-Watt radioisotope thermoelectric generators (MHW RTG). Each RTG includes 24 pressed plutonium oxide spheres, and provided enough heat to generate approximately 157 W of electrical power at launch. Collectively, the RTGs supplied the spacecraft with 470 watts at launch, and will allow operations to continue until at least 2020.[10][12][13]
For more details on the Voyager space probes' identical instrument packages, see the separate article on the overall Voyager Program.

Images of the spacecraft
Voyager spacecraft diagram
Voyager spacecraft diagram.
Voyager in transport to a solar thermal test chamber
Voyager in transport to a solar thermal test chamber.
Voyager 2 awaiting payload entry into a Titan IIIE/Centaur rocket. 

Mission profile

Voyager 2 skypath 1977-2030.png
Voyager 2's trajectory from the earth, following the ecliptic
through 1989 at Neptune and now heading south into the
constellation Pavo
Timeline of travel
Date Event
1977-08-20 Spacecraft launched at 14:29:00 UTC.
1977-12-10 Entered asteroid belt.
1977-12-19 Voyager 1 overtakes Voyager 2. (see diagram)
1978-06 Primary radio receiver fails. Remainder of mission flown using backup.
1978-10-21 Exited asteroid belt
1979-04-25 Start Jupiter observation phase
1981-06-05 Start Saturn observation phase.
1985-11-04 Start Uranus observation phase.
1987-08-20 10 years of continuous flight and operation at 14:29:00 UTC.
1989-06-05 Start Neptune observation phase.
1989-10-02 Begin Voyager Interstellar Mission.
Interstellar phase[16][17][18]
1997-08-20 20 years of continuous flight and operation at 14:29:00 UTC.
1998-11-13 Terminate scan platform and UV observations.
2007-08-20 30 years of continuous flight and operation at 14:29:00 UTC.
2007-09-06 Terminate data tape recorder operations.
2008-02-22 Terminate planetary radio astronomy experiment operations.
2011-11-07 Switch to backup thrusters to conserve power[19]
2017-08-20 40 years of continuous flight and operation at 14:29:00 UTC.

Launch and trajectory

The Voyager 2 probe was launched on August 20, 1977, by NASA from Space Launch Complex 41 at Cape Canaveral, Florida, aboard a Titan IIIE/Centaur launch vehicle. Two weeks later, the twin Voyager 1 probe would be launched on September 5, 1977. However, Voyager 1 would reach both Jupiter and Saturn sooner, as Voyager 2 had been launched into a longer, more circular trajectory.

Encounter with Jupiter


The trajectory of Voyager 2 through the Jupiter system

Voyager 2's closest approach to Jupiter occurred on July 9, 1979. It came within 570,000 km (350,000 mi) of the planet's cloud tops.[21] It discovered a few rings around Jupiter, as well as volcanic activity on the moon Io.

The Great Red Spot was revealed as a complex storm moving in a counterclockwise direction. An array of other smaller storms and eddies were found throughout the banded clouds.

Discovery of active volcanism on Io was easily the greatest unexpected discovery at Jupiter. It was the first time active volcanoes had been seen on another body in the Solar System. Together, the Voyagers observed the eruption of nine volcanoes on Io, and there is evidence that other eruptions occurred between the two Voyager fly-bys.

The moon Europa displayed a large number of intersecting linear features in the low-resolution photos from Voyager 1. At first, scientists believed the features might be deep cracks, caused by crustal rifting or tectonic processes. The closer high-resolution photos from Voyager 2, however, left scientists puzzled: The features were so lacking in topographic relief that as one scientist described them, they "might have been painted on with a felt marker." Europa is internally active due to tidal heating at a level about one-tenth that of Io. Europa is thought to have a thin crust (less than 30 km (19 mi) thick) of water ice, possibly floating on a 50-kilometer-deep (30 mile) ocean.

Two new, small satellites, Adrastea and Metis, were found orbiting just outside the ring. A third new satellite, Thebe, was discovered between the orbits of Amalthea and Io.

The Great Red Spot photographed during the Voyager 2 flyby of Jupiter
The Great Red Spot photographed during the Voyager 2 flyby of Jupiter.
A transit of Io across Jupiter, July 9, 1979
A transit of Io across Jupiter, July 9, 1979. 
Eruption of a volcano on Io, photographed by Voyager 2
Eruption of a volcano on Io, photographed by Voyager 2.
A color mosaic of Europa
A color mosaic of Europa.
A color mosaic of Ganymede
A color mosaic of Ganymede.
Callisto photographed at a distance of 1 million kilometers
Callisto photographed at a distance of 1 million kilometers.
One ring of Jupiter photographed during the Voyager 2 flyby of Jupiter
One faint ring of Jupiter photographed during the flyby.
An eruptive event that occurred as Voyager 2 approached Jupiter
Atmospheric eruptive event on Jupiter.

Encounter with Saturn

The closest approach to Saturn occurred on August 26, 1981.[22]

While passing behind Saturn (as viewed from Earth), Voyager 2 probed Saturn's upper atmosphere with its radio link to gather information on atmospheric temperature and density profiles. Voyager 2 found that at the uppermost pressure levels (seven kilopascals of pressure), Saturn's temperature was 70 kelvins (−203 °C), while at the deepest levels measured (120 kilopascals) the temperature increased to 143 K (−130 °C). The north pole was found to be 10 kelvins cooler, although this may be seasonal (see also Saturn Oppositions).

After the fly-by of Saturn, the camera platform of Voyager 2 locked up briefly, putting plans to officially extend the mission to Uranus and Neptune in jeopardy. The mission's engineers were able to fix the problem (caused by an overuse that temporarily depleted its lubricant), and the Voyager 2 probe was given the go-ahead to explore the Uranian system.

Voyager 2 Saturn approach view
Voyager 2 Saturn approach view. 
North, polar region of Saturn imaged in orange and UV filters
North, polar region of Saturn imaged in orange and UV filters. 
Color image of Enceladus showing terrain of widely varying ages
Color image of Enceladus showing terrain of widely varying ages. 
Cratered surface of Tethys at 594,000 km
Cratered surface of Tethys at 594,000 km. 
Atmosphere of Titan imaged from 2.3 million km
Atmosphere of Titan imaged from 2.3 million km. 
Titan occultation of the Sun from 0.9 million km
Titan occultation of the Sun from 0.9 million km. 
Two-toned Iapetus from Voyager 2, August 22, 1981
Two-toned Iapetus, August 22, 1981. 
"Spoke" features observed in the rings of Saturn
"Spoke" features observed in the rings of Saturn. 

Encounter with Uranus


The closest approach to Uranus occurred on January 24, 1986, when Voyager 2 came within 81,500 kilometers (50,600 mi) of the planet's cloud tops. Voyager 2 also discovered the moons Cordelia, Ophelia, Bianca, Cressida, Desdemona, Juliet, Portia, Rosalind, Belinda, Perdita and Puck; studied the planet's unique atmosphere, caused by its axial tilt of 97.8°; and examined the Uranian ring system.

Uranus is the third largest (Neptune has a larger mass, but a smaller volume) planet in the Solar System. It orbits the Sun at a distance of about 2.8 billion kilometers (1.7 billion miles), and it completes one orbit every 84 Earth years. The length of a day on Uranus as measured by Voyager 2 is 17 hours, 14 minutes. Uranus is unique among the planets in that its axial tilt is about 90°, meaning that its axis is roughly parallel with, not perpendicular to, the plane of the ecliptic. This extremely large tilt of its axis is thought to be the result of a collision between the accumulating planet Uranus with another planet-sized body early in the history of the Solar System. Given the unusual orientation of its axis, with the polar regions of Uranus exposed for periods of many years to either continuous sunlight or darkness, planetary scientists were not at all sure what to expect when observing Uranus.

Voyager 2 found that one of the most striking effects of the sideways orientation of Uranus is the effect on the tail of the planetary magnetic field. This is itself tilted about 60° from the Uranian axis of rotation. The planet's magneto tail was shown to be twisted by the rotation of Uranus into a long corkscrew shape following the planet. The presence of a significant magnetic field for Uranus was not at all known until Voyager 2's arrival.

The radiation belts of Uranus were found to be of an intensity similar to those of Saturn. The intensity of radiation within the Uranian belts is such that irradiation would "quickly" darken — within 100,000 years — any methane that is trapped in the icy surfaces of the inner moons and ring particles. This kind of darkening might have contributed to the darkened surfaces of the moons and the ring particles, which are almost uniformly dark gray in color.

A high layer of haze was detected around the sunlit pole of Uranus. This area was also found to radiate large amounts of ultraviolet light, a phenomenon that is called "dayglow." The average atmospheric temperature is about 60 K (−350°F/−213°C). Surprisingly, the illuminated and dark poles, and most of the planet, exhibit nearly the same temperatures at the cloud tops.

The Uranian moon Miranda, the innermost of the five large moons, was discovered to be one of the strangest bodies yet seen in the Solar System. Detailed images from Voyager 2's flyby of Miranda showed huge canyons made from geological faults as deep as 20 kilometers (12 mi), terraced layers, and a mixture of old and young surfaces. One hypothesis suggests that Miranda might consist of a reaggregation of material following an earlier event when Miranda was shattered into pieces by a violent impact.

All nine of the previously known Uranian rings were studied by the instruments of Voyager 2. These measurements showed that the Uranian rings are distinctly different from those at Jupiter and Saturn. The Uranian ring system might be relatively young, and it did not form at the same time that Uranus did. The particles that make up the rings might be the remnants of a moon that was broken up by either a high-velocity impact or torn up by tidal effects.

Uranus as viewed by Voyager 2
Uranus as viewed by Voyager 2
Departing image of crescent Uranus
Departing image of crescent Uranus.
Fractured surface of Miranda
Fractured surface of Miranda.
Ariel as imaged from 130,000 km
Ariel as imaged from 130,000 km.
Color composite of Titania from 500,000 km
Color composite of Titania from 500,000 km.
Umbriel imaged from 550,000 km
Umbriel (moon) imaged from 550,000 km.
Oberon (computer generated image)
Oberon (computer generated image).
Voyager 2 photo of the Rings of Uranus
The Rings of Uranus imaged by Voyager 2.

Encounter with Neptune

Following a mid-course correction in 1987, Voyager 2's closest approach to Neptune occurred on August 25, 1989.[23][24][25] Because this was the last planet of the Solar System that Voyager 2 could visit, the Chief Project Scientist, his staff members, and the flight controllers decided to also perform a close fly-by of Triton, the larger of Neptune's two originally known moons, so as to gather as much information on Neptune and Triton as possible, regardless of Voyager 2's departure angle from the planet. This was just like the case of Voyager 1's encounters with Saturn and its massive moon Titan.Through repeated computerized test simulations of trajectories through the Neptunian system conducted in advance, flight controllers determined the best way to route Voyager 2 through the Neptune-Triton system. Since the plane of the orbit of Triton is tilted significantly with respect to the plane of the ecliptic, through mid-course corrections, Voyager 2 was directed into a path about three thousand miles above the north pole of Neptune.[26] At that time, Triton was behind and below (south of) Neptune (at an angle of about 25 degrees below the ecliptic), close to the apoapsis of its elliptical orbit. The gravitational pull of Neptune bent the trajectory of Voyager 2 down in the direction of Triton. In less than 24 hours, Voyager 2 traversed the distance between Neptune and Triton, and then observed Triton's northern hemisphere as it passed over its north pole.

The net and final effect on Voyager 2 was to bend its trajectory south below the plane of the ecliptic by about 30 degrees. Voyager 2 is on this path permanently, and hence, it is exploring space south of the plane of the ecliptic, measuring magnetic fields, charged particles, etc., there, and sending the measurements back to the Earth via telemetry.

While in the neighborhood of Neptune, Voyager 2 discovered the "Great Dark Spot", which has since disappeared, according to observations by the Hubble Space Telescope. Originally thought to be a large cloud itself, the "Great Dark Spot" was later hypothesized to be a hole in the visible cloud deck of Neptune.

With the decision of the International Astronomical Union to reclassify Pluto as a "dwarf planet" in 2006, the flyby of Neptune by Voyager 2 in 1989 became the point when every known planet in the Solar System had been visited at least once by a space probe.

Voyager 2 image of Neptune
Voyager 2 image of Neptune.
Neptune and Triton three days after Voyager's flyby
Neptune and Triton three days after Voyager 2 flyby.
Despina as imaged from Voyager 2
Despina as imaged from Voyager 2.
Cratered surface of Larissa
Cratered surface of Larissa. 

Interstellar mission

Once its planetary mission was over, Voyager 2 was described as working on an interstellar mission, which NASA is using to find out what the Solar System is like beyond the heliosphere. Voyager 2 is currently transmitting scientific data at about 160 bits per second. Information about continuing telemetry exchanges with Voyager 2 is available from Voyager Weekly Reports.[27]

yellow spot surrounded by three concentric light-blue ellipses labeled from inside to out: Saturn, Uranus and Neptune. A grey ellipse labeled Pluto overlaps Neptune's ellipse. Four colored lines trail outwards from the central spot: a short red line labelled Voyager 2 traces to the right and up; a green and longer line labelled Pioneer 11 traces to the right; a purple line labelled Voyager 1 traces to the bottom right corner; and a dark blue line labelled Pioneer 10 traces left
Map showing location and trajectories of the Pioneer 10, Pioneer 11, Voyager 1, and Voyager 2 spacecraft, as of April 4, 2007.

On November 29, 2006, a telemetered command to Voyager 2 was incorrectly decoded by its on-board computer—in a random error—as a command to turn on the electrical heaters of the spacecraft's magnetometer. These heaters remained turned on until December 4, 2006, and during that time, there was a resulting high temperature above 130 °C (266 °F), significantly higher than the magnetometers were designed to endure, and a sensor rotated away from the correct orientation. As of this date it had not been possible to fully diagnose and correct for the damage caused to Voyager 2's magnetometer, although efforts to do so were proceeding.[28]

On August 30, 2007, Voyager 2 passed the termination shock and then entered into the heliosheath, approximately 1 billion miles (1.6 billion km) closer to the Sun than Voyager 1 did.[29] This is due to the interstellar magnetic field of deep space. The southern hemisphere of the Solar System's heliosphere is being pushed in.[30]

On April 22, 2010, Voyager 2 encountered scientific data format problems.[31] On May 17, 2010, JPL engineers revealed that a flipped bit in an on-board computer had caused the issue, and scheduled a bit reset for May 19.[32] On May 23, 2010, Voyager 2 resumed sending science data from deep space after engineers fixed the flipped bit.[33] Currently research is being made into marking the area of memory with the flipped bit off limits or disallowing its use. The Low-Energy Charged Particle Instrument is currently operational, and data from this instrument concerning charged particles is being transmitted to Earth. This data permits measurements of the heliosheath and termination shock. There has also been a modification to the on-board flight software to delay turning off the AP Branch 2 backup heater for one year. It was scheduled to go off February 2, 2011 (DOY 033, 2011–033).


Simulated view of the position of Voyager 2 as of February 8, 2012 showing spacecraft trajectory since launch

On July 25, 2012, Voyager 2 was traveling at 15.447 km/s relative to the Sun at about 99.13 astronomical units (1.4830×1010 km) from the Sun,[6] at −55.29° declination and 19.888 h right ascension, and also at an ecliptic latitude of −34.0 degrees, placing it in the constellation Telescopium as observed from Earth.[34] This location places it deep in the scattered disc, and traveling outward at roughly 3.264 AU per year. It is more than twice as far from the Sun as Pluto, and far beyond the perihelion of 90377 Sedna, but not yet beyond the outer limits of the orbit of the dwarf planet Eris.

On September 9, 2012, Voyager 2 was 99.077 AU (1.48217×1010 km; 9.2098×109 mi) from the Earth and 99.504 AU (1.48856×1010 km; 9.2495×109 mi) from the Sun; and traveling at 15.436 km/s (34,530 mph) (relative to the Sun) and traveling outward at about 3.256 AU per year.[35] Sunlight takes 13.73 hours to get to Voyager 2. The brightness of the Sun from the spacecraft is magnitude -16.7.[35] Voyager 2 is heading in the direction of the constellation Telescopium.[35] (To compare, Proxima Centauri, the closest star to the Sun, is about 4.2 light-years (or 2.65×105 AU) distant. Voyager 2's current relative velocity to the Sun is 15.436 km/s (55,570 km/h; 34,530 mph). This calculates as 3.254 AU per year, about 10% slower than Voyager 1. At this velocity, 81,438 years would pass before Voyager 2 reaches the nearest star, Proxima Centauri, were the spacecraft traveling in the direction of that star. (Voyager 2 will need about 19,390 years at its current velocity to travel a complete light year)

On November 7, 2012, Voyager 2 reached 100 AU from the sun, making it the third human-made object to reach 100 AU. Voyager 1 was 122 AU from the Sun, and Pioneer 10 is presumed to be at 107 AU. While Pioneer has ceased communications, both the Voyager spacecraft are performing well and are still communicating.


The current position of Voyagers as of early 2013. Note the vast distances condensed into an exponential scale: Earth is 1 astronomical unit (AU) from the Sun; Saturn is at 9 AU, and the heliopause is at more than 100 AU. Neptune is 30.1 AU from the Sun; thus the edge of interstellar space is more than three times as far from the Sun as the last planet.

In 2013 Voyager 1 was escaping the solar system at a speed of about 3.6 AU per year, while Voyager 2 was only escaping at 3.3 AU per year.[36] (Each year Voyager 1 increases its lead over Voyager 2)

By March 17, 2018, Voyager 2 was at a distance of 117 AU (1.75×1010 km) from the Sun.[6] There is a variation in distance from Earth caused by the Earth's revolution around the Sun relative to Voyager 2.[6]

Future of the probe

It was originally thought that Voyager 2 would enter interstellar space in early 2016, with its plasma spectrometer providing the first direct measurements of the density and temperature of the interstellar plasma.[37]

However, the spacecraft may instead reach interstellar space sometime in either late 2019 or early 2020, when it will reach a similar distance from the Sun as Voyager 1 did when it crossed into interstellar space back in 2012. Voyager 2 is not headed toward any particular star, although in roughly 40,000 years it should pass 1.7 light-years from the star Ross 248.[38] And if undisturbed for 296,000 years, Voyager 2 should pass by the star Sirius at a distance of 4.3 light-years. Voyager 2 is expected to keep transmitting weak radio messages until at least 2025, over 48 years after it was launched.[39]

Year End of specific capabilities as a result of the available electrical power limitations[40]
1998 Termination of scan platform and UVS observations
2007 Termination of Digital Tape Recorder (DTR) operations (It was no longer needed due to a failure on the High Waveform Receiver on the Plasma Wave Subsystem (PWS) on June 30, 2002.[41])
2008 Power off Planetary Radio Astronomy Experiment (PRA)
2016 approx Termination of gyroscopic operations
2020 approx Initiate instrument power sharing
2025 or slightly afterwards Can no longer power any single instrument

Golden record

A child's greeting in English recorded on the Voyager Golden Record

Voyager Golden Record

Object-oriented programming

From Wikipedia, the free encyclopedia

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. A feature of objects is that an object's procedures can access and often modify the data fields of the object with which they are associated (objects have a notion of "this" or "self"). In OOP, computer programs are designed by making them out of objects that interact with one another.[1][2] There is significant diversity of OOP languages, but the most popular ones are class-based, meaning that objects are instances of classes, which typically also determine their type.

Many of the most widely used programming languages (such as C++, Object Pascal, Java, Python etc.) are multi-paradigm programming languages that support object-oriented programming to a greater or lesser degree, typically in combination with imperative, procedural programming. Significant object-oriented languages include Java, C++, C#, Python, PHP, Ruby, Perl, Object Pascal, Objective-C, Dart, Swift, Scala, Common Lisp, and Smalltalk.

Features

Object-oriented programming uses objects, but not all of the associated techniques and structures are supported directly in languages that claim to support OOP. The features listed below are, however, common among languages considered strongly class- and object-oriented (or multi-paradigm with OOP support), with notable exceptions mentioned.[3][4][5][6]

Shared with non-OOP predecessor languages

Modular programming support provides the ability to group procedures into files and modules for organizational purposes. Modules are namespaced so identifiers in one module will not be accidentally confused with a procedure or variable sharing the same name in another file or module.

Objects and classes

Languages that support object-oriented programming typically use inheritance for code reuse and extensibility in the form of either classes or prototypes. Those that use classes support two main concepts:
  • Classes – the definitions for the data format and available procedures for a given type or class of object; may also contain data and procedures (known as class methods) themselves, i.e. classes contain the data members and member functions
  • Objects – instances of classes
Objects sometimes correspond to things found in the real world. For example, a graphics program may have objects such as "circle", "square", "menu". An online shopping system might have objects such as "shopping cart", "customer", and "product".[7] Sometimes objects represent more abstract entities, like an object that represents an open file, or an object that provides the service of translating measurements from U.S. customary to metric.

Each object is said to be an instance of a particular class (for example, an object with its name field set to "Mary" might be an instance of class Employee). Procedures in object-oriented programming are known as methods; variables are also known as fields, members, attributes, or properties. This leads to the following terms:
  • Class variables – belong to the class as a whole; there is only one copy of each one
  • Instance variables or attributes – data that belongs to individual objects; every object has its own copy of each one
  • Member variables – refers to both the class and instance variables that are defined by a particular class
  • Class methods – belong to the class as a whole and have access only to class variables and inputs from the procedure call
  • Instance methods – belong to individual objects, and have access to instance variables for the specific object they are called on, inputs, and class variables
Objects are accessed somewhat like variables with complex internal structure, and in many languages are effectively pointers, serving as actual references to a single instance of said object in memory within a heap or stack. They provide a layer of abstraction which can be used to separate internal from external code. External code can use an object by calling a specific instance method with a certain set of input parameters, read an instance variable, or write to an instance variable. Objects are created by calling a special type of method in the class known as a constructor. A program may create many instances of the same class as it runs, which operate independently. This is an easy way for the same procedures to be used on different sets of data.

Object-oriented programming that uses classes is sometimes called class-based programming, while prototype-based programming does not typically use classes. As a result, a significantly different yet analogous terminology is used to define the concepts of object and instance.

In some languages classes and objects can be composed using other concepts like traits and mixins.

Class-based vs prototype-based

In class-based languages the classes are defined beforehand and the objects are instantiated based on the classes. If two objects apple and orange are instantiated from the class Fruit, they are inherently fruits and it is guaranteed that you may handle them in the same way; e.g. a programmer can expect the existence of the same attributes such as color or sugar content or is ripe.

In prototype-based languages the objects are the primary entities. No classes even exist. The prototype of an object is just another object to which the object is linked. Every object has one prototype link (and only one). New objects can be created based on already existing objects chosen as their prototype. You may call two different objects apple and orange a fruit, if the object fruit exists, and both apple and orange have fruit as their prototype. The idea of the fruit class doesn't exist explicitly, but as the equivalence class of the objects sharing the same prototype. The attributes and methods of the prototype are delegated to all the objects of the equivalence class defined by this prototype. The attributes and methods owned individually by the object may not be shared by other objects of the same equivalence class; e.g. the attributes sugar content may be unexpectedly not present in apple. Only single inheritance can be implemented through the prototype.

Dynamic dispatch/message passing

It is the responsibility of the object, not any external code, to select the procedural code to execute in response to a method call, typically by looking up the method at run time in a table associated with the object. This feature is known as dynamic dispatch, and distinguishes an object from an abstract data type (or module), which has a fixed (static) implementation of the operations for all instances. If the call variability relies on more than the single type of the object on which it is called (i.e. at least one other parameter object is involved in the method choice), one speaks of multiple dispatch.

A method call is also known as message passing. It is conceptualized as a message (the name of the method and its input parameters) being passed to the object for dispatch.

Encapsulation

Encapsulation is an object-oriented programming concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse. Data encapsulation led to the important OOP concept of data hiding.

If a class does not allow calling code to access internal object data and permits access through methods only, this is a strong form of abstraction or information hiding known as encapsulation. Some languages (Java, for example) let classes enforce access restrictions explicitly, for example denoting internal data with the private keyword and designating methods intended for use by code outside the class with the public keyword. Methods may also be designed public, private, or intermediate levels such as protected (which allows access from the same class and its subclasses, but not objects of a different class). In other languages (like Python) this is enforced only by convention (for example, private methods may have names that start with an underscore). Encapsulation prevents external code from being concerned with the internal workings of an object. This facilitates code refactoring, for example allowing the author of the class to change how objects of that class represent their data internally without changing any external code (as long as "public" method calls work the same way). It also encourages programmers to put all the code that is concerned with a certain set of data in the same class, which organizes it for easy comprehension by other programmers. Encapsulation is a technique that encourages decoupling.

Composition, inheritance, and delegation

Objects can contain other objects in their instance variables; this is known as object composition. For example, an object in the Employee class might contain (either directly or through a pointer) an object in the Address class, in addition to its own instance variables like "first_name" and "position". Object composition is used to represent "has-a" relationships: every employee has an address, so every Employee object has access to a place to store an Address object (either directly embedded within itself, or at a separate location addressed via a pointer).

Languages that support classes almost always support inheritance. This allows classes to be arranged in a hierarchy that represents "is-a-type-of" relationships. For example, class Employee might inherit from class Person. All the data and methods available to the parent class also appear in the child class with the same names. For example, class Person might define variables "first_name" and "last_name" with method "make_full_name()". These will also be available in class Employee, which might add the variables "position" and "salary". This technique allows easy re-use of the same procedures and data definitions, in addition to potentially mirroring real-world relationships in an intuitive way. Rather than utilizing database tables and programming subroutines, the developer utilizes objects the user may be more familiar with: objects from their application domain.[9]

Subclasses can override the methods defined by superclasses. Multiple inheritance is allowed in some languages, though this can make resolving overrides complicated. Some languages have special support for mixins, though in any language with multiple inheritance, a mixin is simply a class that does not represent an is-a-type-of relationship. Mixins are typically used to add the same methods to multiple classes. For example, class UnicodeConversionMixin might provide a method unicode_to_ascii() when included in class FileReader and class WebPageScraper, which don't share a common parent.

Abstract classes cannot be instantiated into objects; they exist only for the purpose of inheritance into other "concrete" classes which can be instantiated. In Java, the final keyword can be used to prevent a class from being subclassed.

The doctrine of composition over inheritance advocates implementing has-a relationships using composition instead of inheritance. For example, instead of inheriting from class Person, class Employee could give each Employee object an internal Person object, which it then has the opportunity to hide from external code even if class Person has many public attributes or methods. Some languages, like Go do not support inheritance at all.

The "open/closed principle" advocates that classes and functions "should be open for extension, but closed for modification".

Delegation is another language feature that can be used as an alternative to inheritance.

Polymorphism

Subtyping, a form of polymorphism, is when calling code can be agnostic as to whether an object belongs to a parent class or one of its descendants. For example, a function might call "make_full_name()" on an object, which will work whether the object is of class Person or class Employee. This is another type of abstraction which simplifies code external to the class hierarchy and enables strong separation of concerns.

Open recursion

In languages that support open recursion, object methods can call other methods on the same object (including themselves), typically using a special variable or keyword called this or self. This variable is late-bound; it allows a method defined in one class to invoke another method that is defined later, in some subclass thereof.

History


UML notation for a class. This Button class has variables for data, and functions. Through inheritance a subclass can be created as subset of the Button class. Objects are instances of a class.

Terminology invoking "objects" and "oriented" in the modern sense of object-oriented programming made its first appearance at MIT in the late 1950s and early 1960s. In the environment of the artificial intelligence group, as early as 1960, "object" could refer to identified items (LISP atoms) with properties (attributes);[10][11] Alan Kay was later to cite a detailed understanding of LISP internals as a strong influence on his thinking in 1966.[12] Another early MIT example was Sketchpad created by Ivan Sutherland in 1960–61; in the glossary of the 1963 technical report based on his dissertation about Sketchpad, Sutherland defined notions of "object" and "instance" (with the class concept covered by "master" or "definition"), albeit specialized to graphical interaction.[13] Also, an MIT ALGOL version, AED-0, established a direct link between data structures ("plexes", in that dialect) and procedures, prefiguring what were later termed "messages", "methods", and "member functions".[14][15]

In the 1960s object-orientated programming was put into practice with the Simula language, which introduced important concepts that are today an essential part of object-orientated programming, such as class and object, inheritance, and dynamic binding.[16] Simula was also designed to take account of programming and data security. For programming security purposes a detection process was implemented so that through reference counts a last resort garbage collector deleted unused objects in the random-access memory (RAM). But although the idea of data objects had already been established by 1965, date encapsulation through levels of scope for variables, such as private (-) and public (+), were not implemented in Simula because it would have required the accessing procedures to be also hidden.[17]

In 1962 Kristen Nygaard initiated a project for a simulation language at the Norwegian Computing Center, based on his previous use of the Monte Carlo simulation and his work to conceptualise real-world systems. Ole-Johan Dahl formally joined the project and the Simula programming language was designed to run on the Universal Automatic Computer (UNIVAC) 1107. In the early stages Simula was supposed to be a procedure package for the programming language ALGOL 60. Dissatisfied with the restrictions imposed by ALGOL the researchers decided to develop Simula into a fully-fledged programming language, which used the UNIVAC ALGOL 60 compiler. Simula launched in 1964, and was promoted by Dahl and Nygaard throughout 1965 and 1966, leading to increasing use of the programming language in Sweden, Germany and the Soviet Union. In 1968 the language became widely available through the Burroughs B5500 computers, and was later also implemented on the URAL-16 computer. In 1966 Dahl and Nygaard wrote a Simula compiler. They became preoccupied with putting into practice Tony Hoare's record class concept, which had been implemented in the free-form, English-like general-purpose simulation language SIMSCRIPT. They settled for a generalised process concept with record class properties, and a second layer of prefixes. Through prefixing a process could reference its predecessor and have additional properties. Simula thus introduced the class and subclass hierarchy, and the possibility of generating objects from these classes. The Simula 1 compiler and a new version of the programming language, Simula 67, was introduced to the wider world through the research paper "Class and Subclass Declarations" at a 1967 conference.[18]

A Simula 67 compiler was launched for the System/360 and System/370 IBM mainframe computers in 1972. In the same year a Simula 67 compiler was launched free of charge for the French CII 10070 and CII Iris 80 mainframe computers. By 1974 the Association of Simula Users had members in 23 different countries. Early 1975 a Simula 67 compiler was released free of charge for the  DecSystem-10 mainframe family. By August the same year the DecSystem Simula 67 compiler had been installed at 28 sites, 22 of them in North America. The object-orientated Simula programming language was used mainly by researchers involved with physical modelling, such as models to study and improve the movement of ships and their content through cargo ports.[19]

In the 1970s the first version of the Smalltalk programming language was developed at Xerox PARC by Alan Kay, Dan Ingalls and Adele Goldberg. Smaltalk-71 included a programming environment and was dynamically typed, and at first was interpreted, not compiled. Smalltalk got noted for its application of object orientation at the language level and its graphical development environment. Smalltalk went through various versions and interest in the language grew.[20] While Smalltalk was influenced by the ideas introduced in Simula 67 it was designed to be a fully dynamic system in which classes could be created and modified dynamically.[21]

In the 1970s Smalltalk influenced the Lisp community to incorporate object-based techniques that were introduced to developers via the Lisp machine. Experimentation with various extensions to Lisp (such as LOOPS and Flavors introducing multiple inheritance and mixins) eventually led to the Common Lisp Object System, which integrates functional programming and object-oriented programming and allows extension via a Meta-object protocol. In the 1980s, there were a few attempts to design processor architectures that included hardware support for objects in memory but these were not successful. Examples include the Intel iAPX 432 and the Linn Smart Rekursiv.

In 1981 Goldberg edited the August 1981 issue of Byte Magazine, introducing Smalltalk and object-orientated programming to a wider audience. In 1986 the Association for Computing Machinery organised the first Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), which was unexpectedly attended by 1,000 people. In the mid-1980s Objective-C was developed by Brad Cox, who had used Smalltalk at ITT Inc., and Bjarne Stroustrup, who had used Simula for his PhD thesis. This work eventually led to the object-orientated C++.[22] In 1985 Bertrand Meyer also produced the first design of the Eiffel language. Focused on software quality, Eiffel is a purely object-oriented programming language and a notation supporting the entire software lifecycle. Meyer described the Eiffel software development method, based on a small number of key ideas from software engineering and computer science, in Object-Oriented Software Construction. Essential to the quality focus of Eiffel is Meyer's reliability mechanism, Design by Contract, which is an integral part of both the method and language.


The TIOBE programming language popularity index graph from 2002 to 2015. In the 2000s the object-orientated Java (blue) and the procedural C (black) competed for the top position.

In the early and mid-1990s object-oriented programming developed as the dominant programming paradigm when programming languages supporting the techniques became widely available. These included Visual FoxPro 3.0,[23][24][25] C++,[26] and Delphi[citation needed]. Its dominance was further enhanced by the rising popularity of graphical user interfaces, which rely heavily upon object-oriented programming techniques. An example of a closely related dynamic GUI library and OOP language can be found in the Cocoa frameworks on Mac OS X, written in Objective-C, an object-oriented, dynamic messaging extension to C based on Smalltalk. OOP toolkits also enhanced the popularity of event-driven programming (although this concept is not limited to OOP).

At ETH Zürich, Niklaus Wirth and his colleagues had also been investigating such topics as data abstraction and modular programming (although this had been in common use in the 1960s or earlier). Modula-2 (1978) included both, and their succeeding design, Oberon, included a distinctive approach to object orientation, classes, and such.

Object-oriented features have been added to many previously existing languages, including Ada, BASIC, Fortran, Pascal, and COBOL. Adding these features to languages that were not initially designed for them often led to problems with compatibility and maintainability of code.

More recently, a number of languages have emerged that are primarily object-oriented, but that are also compatible with procedural methodology. Two such languages are Python and Ruby. Probably the most commercially important recent object-oriented languages are Java, developed by Sun Microsystems, as well as C# and Visual Basic.NET (VB.NET), both designed for Microsoft's .NET platform. Each of these two frameworks shows, in its own way, the benefit of using OOP by creating an abstraction from implementation. VB.NET and C# support cross-language inheritance, allowing classes defined in one language to subclass classes defined in the other language.

OOP languages

Simula (1967) is generally accepted as being the first language with the primary features of an object-oriented language. It was created for making simulation programs, in which what came to be called objects were the most important information representation. Smalltalk (1972 to 1980) is another early example, and the one with which much of the theory of OOP was developed. Concerning the degree of object orientation, the following distinctions can be made:

OOP in dynamic languages

In recent years, object-oriented programming has become especially popular in dynamic programming languages. Python, PowerShell, Ruby and Groovy are dynamic languages built on OOP principles, while Perl and PHP have been adding object-oriented features since Perl 5 and PHP 4, and ColdFusion since version 6.

The Document Object Model of HTML, XHTML, and XML documents on the Internet has bindings to the popular JavaScript/ECMAScript language. JavaScript is perhaps the best known prototype-based programming language, which employs cloning from prototypes rather than inheriting from a class (contrast to class-based programming). Another scripting language that takes this approach is Lua.

OOP in a network protocol

The messages that flow between computers to request services in a client-server environment can be designed as the linearizations of objects defined by class objects known to both the client and the server. For example, a simple linearized object would consist of a length field, a code point identifying the class, and a data value. A more complex example would be a command consisting of the length and code point of the command and values consisting of linearized objects representing the command's parameters. Each such command must be directed by the server to an object whose class (or superclass) recognizes the command and is able to provide the requested service. Clients and servers are best modeled as complex object-oriented structures. Distributed Data Management Architecture (DDM) took this approach and used class objects to define objects at four levels of a formal hierarchy:
  • Fields defining the data values that form messages, such as their length, codepoint and data values.
  • Objects and collections of objects similar to what would be found in a Smalltalk program for messages and parameters.
  • Managers similar to AS/400 objects, such as a directory to files and files consisting of metadata and records. Managers conceptually provide memory and processing resources for their contained objects.
  • A client or server consisting of all the managers necessary to implement a full processing environment, supporting such aspects as directory services, security and concurrency control.
The initial version of DDM defined distributed file services. It was later extended to be the foundation of Distributed Relational Database Architecture (DRDA).

Design patterns

Challenges of object-oriented design are addressed by several approaches. Most common is known as the design patterns codified by Gamma et al.. More broadly, the term "design patterns" can be used to refer to any general, repeatable, solution pattern to a commonly occurring problem in software design. Some of these commonly occurring problems have implications and solutions particular to object-oriented development.

Inheritance and behavioral subtyping

It is intuitive to assume that inheritance creates a semantic "is a" relationship, and thus to infer that objects instantiated from subclasses can always be safely used instead of those instantiated from the superclass. This intuition is unfortunately false in most OOP languages, in particular in all those that allow mutable objects. Subtype polymorphism as enforced by the type checker in OOP languages (with mutable objects) cannot guarantee behavioral subtyping in any context. Behavioral subtyping is undecidable in general, so it cannot be implemented by a program (compiler). Class or object hierarchies must be carefully designed, considering possible incorrect uses that cannot be detected syntactically. This issue is known as the Liskov substitution principle.

Gang of Four design patterns

Design Patterns: Elements of Reusable Object-Oriented Software is an influential book published in 1995 by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, often referred to humorously as the "Gang of Four". Along with exploring the capabilities and pitfalls of object-oriented programming, it describes 23 common programming problems and patterns for solving them. As of April 2007, the book was in its 36th printing. The book describes the following patterns:

Object-orientation and databases

Both object-oriented programming and relational database management systems (RDBMSs) are extremely common in software today. Since relational databases don't store objects directly (though some RDBMSs have object-oriented features to approximate this), there is a general need to bridge the two worlds. The problem of bridging object-oriented programming accesses and data patterns with relational databases is known as object-relational impedance mismatch. There are a number of approaches to cope with this problem, but no general solution without downsides.[28] One of the most common approaches is object-relational mapping, as found in IDE languages such as Visual FoxPro and libraries such as Java Data Objects and Ruby on Rails' ActiveRecord.

There are also object databases that can be used to replace RDBMSs, but these have not been as technically and commercially successful as RDBMSs.

Real-world modeling and relationships

OOP can be used to associate real-world objects and processes with digital counterparts. However, not everyone agrees that OOP facilitates direct real-world mapping (see Criticism section) or that real-world mapping is even a worthy goal; Bertrand Meyer argues in Object-Oriented Software Construction[29] that a program is not a model of the world but a model of some part of the world; "Reality is a cousin twice removed". At the same time, some principal limitations of OOP have been noted.[30] For example, the circle-ellipse problem is difficult to handle using OOP's concept of inheritance.

However, Niklaus Wirth (who popularized the adage now known as Wirth's law: "Software is getting slower more rapidly than hardware becomes faster") said of OOP in his paper, "Good Ideas through the Looking Glass", "This paradigm closely reflects the structure of systems 'in the real world', and it is therefore well suited to model complex systems with complex behaviours"[31] (contrast KISS principle).

Steve Yegge and others noted that natural languages lack the OOP approach of strictly prioritizing things (objects/nouns) before actions (methods/verbs).[32] This problem may cause OOP to suffer more convoluted solutions than procedural programming.[33]

OOP and control flow

OOP was developed to increase the reusability and maintainability of source code.[34] Transparent representation of the control flow had no priority and was meant to be handled by a compiler. With the increasing relevance of parallel hardware and multithreaded coding, developing transparent control flow becomes more important, something hard to achieve with OOP.[35][36][37][38]

Responsibility- vs. data-driven design

Responsibility-driven design defines classes in terms of a contract, that is, a class should be defined around a responsibility and the information that it shares. This is contrasted by Wirfs-Brock and Wilkerson with data-driven design, where classes are defined around the data-structures that must be held. The authors hold that responsibility-driven design is preferable.

SOLID and GRASP guidelines

SOLID is a mnemonic invented by Michael Feathers that stands for and advocates five programming practices:
GRASP (General Responsibility Assignment Software Patterns) is another set of guidelines advocated by Craig Larman.

Criticism

The OOP paradigm has been criticised for a number of reasons, including not meeting its stated goals of reusability and modularity,[39][40] and for overemphasizing one aspect of software design and modeling (data/objects) at the expense of other important aspects (computation/algorithms).[41][42]

Luca Cardelli has claimed that OOP code is "intrinsically less efficient" than procedural code, that OOP can take longer to compile, and that OOP languages have "extremely poor modularity properties with respect to class extension and modification", and tend to be extremely complex.[39] The latter point is reiterated by Joe Armstrong, the principal inventor of Erlang, who is quoted as saying:[40]
The problem with object-oriented languages is they've got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.
A study by Potok et al. has shown no significant difference in productivity between OOP and procedural approaches.[43]

Christopher J. Date stated that critical comparison of OOP to other technologies, relational in particular, is difficult because of lack of an agreed-upon and rigorous definition of OOP;[44] however, Date and Darwen have proposed a theoretical foundation on OOP that uses OOP as a kind of customizable type system to support RDBMS.[45]

In an article Lawrence Krubner claimed that compared to other languages (LISP dialects, functional languages, etc.) OOP languages have no unique strengths, and inflict a heavy burden of unneeded complexity.[46]

Alexander Stepanov compares object orientation unfavourably to generic programming:[41]
I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras — families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is true it is not very interesting — saying that everything is an object is saying nothing at all.
Paul Graham has suggested that OOP's popularity within large companies is due to "large (and frequently changing) groups of mediocre programmers". According to Graham, the discipline imposed by OOP prevents any one programmer from "doing too much damage".[47]

Leo Brodie has suggested a connection between the standalone nature of objects and a tendency to duplicate code[48] in violation of the don't repeat yourself principle[49] of software development. Duplicate code may be tricky to avoid in situations where objects of different classes include methods having similar functionality.[50] The abstract factory pattern has been suggested as a remedy for these situations.[51] However, there are pitfalls associated with refactoring a class so as to create objects via an abstract factory; these pitfalls can include breaking existing clients of the class and limiting the ability to extend the class.[52]

Steve Yegge noted that, as opposed to functional programming:[53]
Object Oriented Programming puts the Nouns first and foremost. Why would you go to such lengths to put one part of speech on a pedestal? Why should one kind of concept take precedence over another? It's not as if OOP has suddenly made verbs less important in the way we actually think. It's a strangely skewed perspective.
Rich Hickey, creator of Clojure, described object systems as overly simplistic models of the real world. He emphasized the inability of OOP to model time properly, which is getting increasingly problematic as software systems become more concurrent.[42]

Eric S. Raymond, a Unix programmer and open-source software advocate, has been critical of claims that present object-oriented programming as the "One True Solution", and has written that object-oriented programming languages tend to encourage thickly layered programs that destroy transparency.[54] Raymond compares this unfavourably to the approach taken with Unix and the C programming language.[54]

Rob Pike, a programmer involved in the creation of UTF-8 and Go, has called object-oriented programming "the Roman numerals of computing"[55] and has said that OOP languages frequently shift the focus from data structures and algorithms to types.[56] Furthermore, he cites an instance of a Java professor whose "idiomatic" solution to a problem was to create six new classes, rather than to simply use a lookup table.[57]

Formal semantics

Objects are the run-time entities in an object-oriented system. They may represent a person, a place, a bank account, a table of data, or any item that the program has to handle.

There have been several attempts at formalizing the concepts used in object-oriented programming. The following concepts and constructs have been used as interpretations of OOP concepts:
Attempts to find a consensus definition or theory behind objects have not proven very successful (however, see Abadi & Cardelli, A Theory of Objects[59] for formal definitions of many OOP concepts and constructs), and often diverge widely. For example, some definitions focus on mental activities, and some on program structuring. One of the simpler definitions is that OOP is the act of using "map" data structures or arrays that can contain functions and pointers to other maps, all with some syntactic and scoping sugar on top. Inheritance can be performed by cloning the maps (sometimes called "prototyping").

Communist society

From Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Communist_society In Marxist thought, a communist society or th...