====== 2.3.4.8.1 Characteristic Data ======
[[dido:public:ra:1.2_views:3_taxonomic:4_data_tax:08_objects:start| Return to Object Data Taxonomy]]
===== Overview =====
[[dido:public:ra:1.2_views:3_taxonomic:4_data_tax:08_objects:01_char:start| Return to Top]]
Every Object has characteristics that contextually describe the object. For example, the Object's name, if it implements and interfaces or if it is an extension of another object.
* **Name** is a textual name that uniquely identifies the object with the context of the [[dido:public:ra:xapend:xapend.a_glossary:n:namespace]]. For example, there are multiple objects with the name **Tank**. The first is in the namespace (i.e., context) of the oil and gas industry and refers to a fuel tank. Another **Tank** object has a military namespace and refers to a military vehicle, and another **Tank** object has a clothing namespace and refers to a "tank top" tee shirt. All the rest of the data for the object is dependent on context (i.e., namespace).
* **Implements** is a way to describe which [[dido:public:ra:xapend:xapend.a_glossary:i:interface | Interfaces]] this object provides an implementation for. An example is the [[dido:public:ra:xapend:xapend.b_stds:defact:ethereum:eip:erc_0020 | ERC-20]] interface used for many [[dido:public:ra:xapend:xapend.a_glossary:c:cryptocurrency | Cryptocurrencies]]. [[dido:public:ra:xapend:xapend.b_stds:defact:orcle:java | Java]] defines standardized collection interfaces for things like List, Set, Queue, Maps and Iterators((
Programiz.com
__Java Collection Frameworks__,
Accessed: 27 October 2021,
[[https://www.programiz.com/java-programming/collections]]
)). C++ has similar interfaces to those described for Java ((
Geeksforgeeks.com,
__The C++ Standard Template Library (STL)__,
Accessed: Accessed: 27 October 2021,
[[https://www.geeksforgeeks.org/the-c-standard-template-library-stl/]]
)). The exact way interfaces are implemented differs from language to language, and can even differ from versions of the same language.
* **Extends** is a way to describe a hierarchical tree for an object (i.e., its [[dido:public:ra:xapend:xapend.a_glossary:i:inheritance]]). For example, a graphics program may have a base object called a **''GeographicShape'''**. Other objects within the graphics program such as **''Square''**, **''Circle''** and **''Triangle''** are said to **extend** the original definition of **''GeographicShape''**.
===== DIDO Specifics =====
[[dido:public:ra:1.2_views:3_taxonomic:4_data_tax:08_objects:01_char:start| Return to Top]]
Smart Contracts are akin to classes in [[dido:public:ra:xapend:xapend.a_glossary:o:oop]] languages; they can have [[dido:public:ra:xapend:xapend.a_glossary:i:inheritance]] and [[dido:public:ra:xapend:xapend.a_glossary:i:interface | Interfaces]]. There are two very well-known examples of **interfaces** in use within [[dido:public:ra:xapend:xapend.a_glossary:e:ethereum]]:
* [[dido:public:ra:xapend:xapend.b_stds:defact:ethereum:eip:erc_0020]]
* [[dido:public:ra:xapend:xapend.b_stds:defact:ethereum:eip:erc_0721]]
However, many of the [[dido:public:ra:xapend:xapend.b_stds:defact:ethereum:eip]] define interfaces.
**Interfaces** are similar to **abstract contracts**, but they are limited to what the contract’s ABI can represent. In other words, you could convert an ABI into an interface, or vice versa, and no information would be lost. According to the Solidity docs they have a few additional restrictions. For example, Doug Crescenzi,
13 June 2018,
Accessed 3 November 2022,
[[https://medium.com/upstate-interactive/solidity-how-to-know-when-to-use-abstract-contracts-vs-interfaces-874cab860c56]]
)) outlines the following restrictions:
* //Interfaces cannot have any functions implemented//
* //Interfaces cannot inherit other contracts or interfaces (contracts can however inherit interfaces just as they would inherit other contracts)//
* //Interfaces cannot define a constructor//
* //Interfaces cannot define variables//
* //Interfaces cannot define structs//
* //Interfaces cannot define enums//
Interfaces are expressed using the interface keyword. Here’s an example:
pragma solidity ^0.4.24;
interface token
{ function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
} // End Token
Review subsections
/**=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/* To add a discussion page to this page, comment out the line that says
~~DISCUSSION:off~~
*/
~~DISCUSSION:on|Outstanding Issues~~
~~DISCUSSION:off~~