Ferreteria/v0.6/clade/Sys/Data/Engine/Oper: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{page/clade}}
{{page/clade/v2
{| style="border: solid 1px black; float: right;"
|fam=
! colspan=3 | Clade Family
{{!}} align=right {{!}}
|-
{{l/ver/clade|IO|Aspect}}<br>
| align=right | {{l/ver/clade|IO|Aspect}}
{{l/ver/clade|Config\Roster\for|AClass}}
| &rarr; {{l/ver/clade|Sys/Data/Engine|Ops}}
{{!}} align=center {{!}} &rArr; {{l/ver/clade|Sys/Data/Engine|Oper}} &rArr;
|
{{!}} align=left  {{!}} {{l/ver/clade|Sys/Data/Engine/Oper|MyMar}}
&rarr; {{l/ver/clade|Sys/Data/Engine/Ops|MyMar}}
|-
! colspan=3 | Aliases
|-
| colspan=3 align=center |


{| class="wikitable sortable"
|alia=
! alias || clade
{{!-!}} '''Action*'''     [i] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Events|ItWent}}
|-
{{!-!}} '''AdminReq*'''   [i] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Data\Engine\aux\ActionRq|AdminRq}}
| '''Action*''' || {{l/ver/clade|Sys\Events|ItWent}} (i)
{{!-!}} '''Base*'''     [c,i] {{!!}} {{l/ver/clade/full|p=ferreteria|IO|Aspect}}
|-
{{!-!}} '''BkupMode*'''   [e] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Data\Engine\aux\ActionRq\Admin\aux|FileFormat}}
| '''AdminReq*''' || {{l/ver/clade|Sys\Data\reqs\Engine|AdminRq}} (i)
{{!-!}} '''DataReq*'''   [i] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Data\Engine\aux|CommRq}}
|-
{{!-!}} '''HasRost*''' [i,t] {{!!}} {{l/ver/clade/full|p=ferreteria|Config\Roster\for|AClass}}
| '''Base*''' || {{l/ver/clade|IO|Aspect}} (c,i)
{{!-!}} '''Schema*'''    [i] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Data\Engine|Schema}}
|-
{{!-!}} '''Schemas*'''   [i] {{!!}} {{l/ver/clade/full|p=ferreteria|Sys\Data\aux\list|Schemas}}
| '''BkupMode*''' || {{l/ver/clade|Sys\Data\reqs\Engine\AdminRq\aux|FileFormat}} (e)
|-
| '''DataReq*''' || {{l/ver/clade|Sys\Data\reqs\Engine|CommRq}} (i)
|-
| '''HasRost*''' || {{l/ver/clade|Config\Roster\for|AClass}} (i,t)
|-
| '''Schemas*''' || {{l/ver/clade|Sys\Data\aux\list|Schemas}} (i)
|}


|}
}}
==About==
* '''Purpose''': engine-agnostic objects for doing ''operations'' on a {{l/ver/clade|Sys\Data|Engine|Database Engine}} via an open DB connection ([[/Conn/]]).
** This mainly descends from the {{l/ver/clade|IO|Aspect|I/O Aspect}} clade. The other major aspect of {{l/ver/clade|Sys\Data|Engine|Database}} management is the {{l/ver/clade|Sys/Data/Engine|Conn|Engine Connection}} clade, which handles the mechanics of ''connecting'' from the [[Ferreteria]] client code to the database server, wherever it may be, and handling I/O therewith.
** Tentatively, must be initialized with a [[/Conn/]] object.
* '''Naming''': short for "operator" or "operations"
* '''Parallel''': [[../Conn/]]
==History==
* {{fmt/date|2025|05|30}} started
* {{fmt/date|2025|11|11}} renamed *Ops -> *Oper, for length-match with *Conn and consistency with related clade names
==Code==
''as of {{fmt/date|2025|11|11}}''
{{fmt/php/block|1=
interface iOper extends BaseIface {
    // ACTION: requests
    function DoDataRequest(DataReqIface $oReq);
    // ACTION: parameterized
    function SchemaList() : SchemasIface;
    function DoUserSetup();
    // OBJECTS
    function GetSchema(string $sName) : SchemaIface;
    #function Register() : RegIface; // SHORTCUT
    // INFO
    function ConnSlug() : string;  // connection shortname
}
abstract class caOper extends BaseClass implements SelfIface {
 
    // ++ CONFIG ++ //
 
    abstract protected function CommOpClass() : string;
    abstract protected function SchemaClass() : string;
    abstract protected function ScribeClass() : string;
 
    // -- CONFIG -- //
    // ++ SETUP ++ //
 
    protected function __construct() {}
 
    // USAGE: Only call if constructing to pass to a Conn object's constructor
    static public function ForConn() : iOper {
        $oThis = new static;
        return $oThis;
    }
    static public function FromConn(ConnIface $oConn) : iOper {
        $oThis = new static;
        $oThis->WithConn($oConn);
        return $oThis;
    }
 
    // ++ SETUP: dynamic ++ //
 
    private $oConn=NULL;
    public function WithConn(ConnIface $oConn) : void {
        $this->oConn = $oConn;
        #$this->RegisterThis();
    }
    protected function OConn() : ConnIface { return $this->oConn; }
 
    // -- SETUP -- //
    // ++ OBJECTS ++ //
 
    // TODO: Rename to OSchema()
    public function GetSchema(string $sName) : SchemaIface { return new ($this->SchemaClass())($this->OConn(),$sName); }
 
    // -- OBJECTS -- //
    // ++ INFO ++ //
 
    public function ConnSlug() : string { return $this->OConn()->ObjectSlug(); }
 
    // -- INFO -- //
    // ++ UI ++ //
 
    // UNPROMPT
    public function DescribeInline() : string { return $this->OConn()->DescribeInline(); }  // sometimes not needed
 
    // -- UI -- //
}
}}
===Removed===
===={{fmt/date|2025|11|11}}====
Removed on {{fmt/date|2025|06|06}}:
{{fmt/php/block|1=
    // 2025-06-06 default should take care of this now
    protected function RegisterThis() {
        $oConn = $this->OConn();
        #echo $oConn->ReflectThis()->Report(); // how do we get the ObjectSlug()?
        $sSlug = $oConn->Slug();
        $this->Register()->SetIt($sSlug,$oConn);
    }
}}

Latest revision as of 17:16, 11 November 2025

clade: Sys\Data\Engine\Oper
Clade Family

Aspect
AClass

Oper MyMar
Clade Aliases
Alias Clade
Action* [i] Sys\Events\ItWent
AdminReq* [i] Sys\Data\Engine\aux\ActionRq\AdminRq
Base* [c,i] IO\Aspect
BkupMode* [e] Sys\Data\Engine\aux\ActionRq\Admin\aux\FileFormat
DataReq* [i] Sys\Data\Engine\aux\CommRq
HasRost* [i,t] Config\Roster\for\AClass
Schema* [i] Sys\Data\Engine\Schema
Schemas* [i] Sys\Data\aux\list\Schemas
Subpages

About

  • Purpose: engine-agnostic objects for doing operations on a Database Engine via an open DB connection (Conn).
    • This mainly descends from the I/O Aspect clade. The other major aspect of Database management is the Engine Connection clade, which handles the mechanics of connecting from the Ferreteria client code to the database server, wherever it may be, and handling I/O therewith.
    • Tentatively, must be initialized with a Conn object.
  • Naming: short for "operator" or "operations"
  • Parallel: Conn

History

  • 2025-05-30 started
  • 2025-11-11 renamed *Ops -> *Oper, for length-match with *Conn and consistency with related clade names

Code

as of 2025-11-11

interface iOper extends BaseIface {
    // ACTION: requests
    function DoDataRequest(DataReqIface $oReq);
    // ACTION: parameterized
    function SchemaList() : SchemasIface;
    function DoUserSetup();
    // OBJECTS
    function GetSchema(string $sName) : SchemaIface;
    #function Register() : RegIface; // SHORTCUT
    // INFO
    function ConnSlug() : string;   // connection shortname
}
abstract class caOper extends BaseClass implements SelfIface {

    // ++ CONFIG ++ //

    abstract protected function CommOpClass() : string;
    abstract protected function SchemaClass() : string;
    abstract protected function ScribeClass() : string;

    // -- CONFIG -- //
    // ++ SETUP ++ //

    protected function __construct() {}

    // USAGE: Only call if constructing to pass to a Conn object's constructor
    static public function ForConn() : iOper {
        $oThis = new static;
        return $oThis;
    }
    static public function FromConn(ConnIface $oConn) : iOper {
        $oThis = new static;
        $oThis->WithConn($oConn);
        return $oThis;
    }

    // ++ SETUP: dynamic ++ //

    private $oConn=NULL;
    public function WithConn(ConnIface $oConn) : void {
        $this->oConn = $oConn;
        #$this->RegisterThis();
    }
    protected function OConn() : ConnIface { return $this->oConn; }

    // -- SETUP -- //
    // ++ OBJECTS ++ //

    // TODO: Rename to OSchema()
    public function GetSchema(string $sName) : SchemaIface { return new ($this->SchemaClass())($this->OConn(),$sName); }

    // -- OBJECTS -- //
    // ++ INFO ++ //

    public function ConnSlug() : string { return $this->OConn()->ObjectSlug(); }

    // -- INFO -- //
    // ++ UI ++ //

    // UNPROMPT
    public function DescribeInline() : string { return $this->OConn()->DescribeInline(); }  // sometimes not needed

    // -- UI -- //
}

Removed

2025-11-11

Removed on 2025-06-06:

// 2025-06-06 default should take care of this now
    protected function RegisterThis() {
        $oConn = $this->OConn();
        #echo $oConn->ReflectThis()->Report(); // how do we get the ObjectSlug()?
        $sSlug = $oConn->Slug();
        $this->Register()->SetIt($sSlug,$oConn);
    }