Wiki

Clone wiki

Oroboros Core / development / api / contract_interface

Oroboros Core

#Oroboros Core


Current Release: 0.2.4

Author: Brian Dayhoff

Copyright: Copyright 2016, all rights reserved.

License: MIT


    #Oroboros Core Contract Interface Specifications#

    Contract interfaces enforce expected methods for interoperability, and remove direct class coupling from the equation.

    The primary purpose of these interfaces is for easy interoperable compatibility, and enforcing expected behavior.

    Internally, they are expected to be provided to verify that a given class registered for internal compatibility is capable of honoring it's stated obligations.

    Classes recognized as internally interoperable MUST implement one or more Contract Interfaces All checks for internal compatibility are done against these.

    You may declare your own set if you are extending this system, which must extend from the following interface (or any child of this interface, if you wish to use additional Oroboros class type expectations)

    \oroboros\core\interfaces\contract\BaseContract

    ##Specifications##

    Contract interfaces follow the following specifications:

    • They MUST inherit \oroboros\core\interfaces\contract\BaseContract
    • They MAY additionally inherit other required compatibility interfaces (eg: \Psr\Log\LoggerAwareInterface)
    • They MAY extend zero or more other Contract Interfaces
    • They MUST NOT extend any Enumerated Api Interfaces (which extend from: \oroboros\core\interfaces\enumerated\BaseEnumeratedApi as their parent),
    • They MUST NOT extend any Api Interface (which extend from: \oroboros\core\interfaces\api\BaseApi as their parent)
    • They MUST NOT directly enforce or declare class constants (however they MAY inherit them from extension of expected external interfaces, if it is unavoidable).

    Updated