Content deleted Content added
→See also: Added one more link |
Notes are now separated from the references |
||
Line 295:
In [[Eiffel (programming language)|Eiffel]], the routines which initialize new objects are called '''creation procedures'''. Creation procedures have the following traits:
* Creation procedures have no explicit return type (by definition of '''procedure''').
* Creation procedures are named.
* Creation procedures are designated by name as creation procedures in the text of the class.
* Creation procedures can be explicitly invoked to re-initialize existing objects.
* Every effective (i.e., concrete or non-abstract) class must designate at least one creation procedure.
* Creation procedures must leave the newly initialized object in a state that satisfies the class invariant.
Although object creation involves some subtleties,<ref name="eiffel standard">[http://www.ecma-international.org/publications/standards/Ecma-367.htm Eiffel ISO/ECMA specification document]</ref> the creation of an attribute with a typical declaration <code lang="eiffel">x: T</code> as expressed in a creation instruction <code lang="eiffel">create x.make</code> consists of the following sequence of steps:
* Create a new direct instance of type <code lang="eiffel">T</code>.
* Execute the creation procedure <code lang="eiffel">make</code> to the newly created instance.
* Attach the newly initialized object to the entity <code lang="eiffel">x</code>.
Line 530:
* [[Destructor (computer science)|Destructor]]
* [[Global constructor]]
== Notes ==
{{Notelist}}
== References ==
{{
[[Category:Method (computer programming)]]
|