Skip to content

Commit

Permalink
Add benefits of abstraction to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
elenadimitrova committed Mar 1, 2018
1 parent 445720b commit 4531a97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ virtual method lookup.

Constructors
============
Constructor is an optional function with the same name as the contract which is executed upon contract creation.
A constructor is an optional function with the same name as the contract which is executed upon contract creation.
Constructor functions can be either ``public`` or ``internal``.

::
Expand Down Expand Up @@ -1078,7 +1078,7 @@ Such contracts cannot be compiled (even if they contain implemented functions al
function utterance() public returns (bytes32) { return "miaow"; }
}

If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract.
If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract.

Note that a function without implementation is different from a :ref:`Function Type <function_types>` even though their syntax looks very similar.

Expand All @@ -1090,6 +1090,8 @@ Example of a Function Type (a variable declaration, where the variable is of typ

function(address) external returns (address) foo;

Abstract contracts decouple the definition of a contract from its implementation providing better extensibility and self-documentation and
facilitating patterns like the `Template method <https://en.wikipedia.org/wiki/Template_method_pattern>`_ and removing code duplication.

.. index:: ! contract;interface, ! interface contract

Expand Down

0 comments on commit 4531a97

Please sign in to comment.