Object (data-processing)

A object is the instanciation of a class within the meaning of the directed Programmation object.

A object is a definition of characteristics specific to an element. For example, one will use only one object for all the cars of a program. Because the cars have all of the common characteristics: they can start, advance, move back etc

In the object languages or directed objects, (ex: Java, C++…), an object is created with the manufacturer of a class (ex: the instruction new). The object gathers the fields and the methods which are its members .

The language is pure object if it makes it possible to create its own classes (ex: Java), it is only directed object if it only makes it possible to handle objects whose classes already exist.

For example, one can use the objects of the spreadsheet Excel with Visual BASIC for Applications, but it is necessary to know of it the existence and the syntax which can be complex: examples:

  • selection of a Worksheet: sheets (" My feuille").select
  • addition of value 10 with a4 cell: concealments (" A4")=10
  • addition of a field to a dynamic cross Table in position line: PivotTables (" My TCD").PivotFields (" My champs").orientation=xlRowFields

Example

In practice, during the programming, one uses a syntax using a point to apply a method to an object:

objet1.méthode1 (paramètre1, parameter 2)

Example: One wishes to create a voiture1 object, pertaining to a class voiture. If this class has a property called NombreDePortes, fixed by defect at 3, and if it has a method called changeNombreDePortes making it possible to change this property, syntax will be:

voiture1=new (car) voiture1.changeNombreDePortes (5)

where 5 is the parameter defining a car in 5 doors.

Thus this syntax with points is characteristic of the object language.

See too

Random links:Orange tree of Mexico | Captain of the people | Interferometry at very long base | Phar | Eighth sum of money | Linda_Gaboriau