This is an old revision of the document!
A Constructor is a special group of Operators that are called when an Object is first created. In most Object-Oriented Programming (OOP) languages (i.e., C++, Java and C#, e.g.), the Constructor has the same name as the Object. It is the initial stage in the Lifecycle of Object Data (see 2.3.4.5 Data Lifecycle Taxonomy). For example, for an Object called Vehicle, the Constructor would also be called Vehicle. The constructor is responsible for the setup of the Object: the initialization of Field Data, the allocation of memory from the Heap. For example, if there are dynamic Field Data, then the memory needed for those Fields is usually allocated from the Heap. Although Constants are generally managed and allocated by the compiler and are from the Stack, Static Field Data can be allocated from the Heap and can be set during construction. For example, the values of Field Data initialized by using initialization parameters on the Constructor or read from initialization or setup files.
Generally, there are three kinds of constructors available in OO:
There is always a default Constructor that required no parameters, however, there can be other Constructors allowing for the passing of values to be used during initialization. For example, the minimum or maximum values used for the Field Data.
Regardless of the number of Constructors, there is always a Constructor that is called when an object is created. Often the calling of a Constructor is automatic and used the default Constructor, but the programmer can use any of the Constructors defined for the Object. See: https://www.tutorialspoint.com/solidity/solidity_constructors.htm
When Data Object is deployed in Ethereum, the following occurs:
The contract is initialized using the Constructor method named: constructor()
Destructor is a special method called automatically during the destruction of an object. Actions executed in the destructor include the following:
When Data Object is destroyed in Ethereum, the following occurs:
selfdestruct() method or the deprecated suicide() method