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 Jan 15, 2018
1 parent 147ab72 commit 1541d1d
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 @@ -1056,7 +1056,8 @@ As an exception, a state variable getter can override a public function.
Abstractions
************

An abstraction type describes a contract but does not provide a full implementation of the contract. An abstraction is implemented as either an abstract contract or interface.
An abstraction type describes a contract but does not provide a full implementation of the contract. An abstraction is implemented as abstract contract or interface.
An abstraction allows you to decouple contract definition from implementation providing better extensibility and self-documentation.

.. index:: ! contract;abstract, ! abstract contract

Expand Down Expand Up @@ -1085,7 +1086,8 @@ 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.
Abstract contracts can implement most of a contract, but leave some methods abstract, facilitating patterns like template method and removing code duplication.
If a contract inherits from an abstract contract and does not implement all non-implemented functions by overriding, it will itself be abstract.

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

Expand Down

0 comments on commit 1541d1d

Please sign in to comment.