Ferreteria/v0.5/portcard: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
'''Navigation''': {{l/ver|PortBank}} : {{l/ver|PortRow}} : {{l/ver|PortCard}}
'''Navigation''': {{l/ver|PortBank}} : {{l/ver|PortRow}} : {{l/ver|PortCard}}
==About==
==About==
Each '''PortCard''' represents a single row of data in a particular format. The standard base formats (which correspond those used by {{l/ver|PortRow}}s) are:
Each '''PortCard''' represents a single row of data in a particular format. The base formats (which correspond those used by {{l/ver|PortRow}}s) are:
* '''[[/calc|Native (calc)]]''', which is used only for internal calculations (no I/O)
* '''root''' ({{l/ver/class|ns=data|caCard}})
* '''[[/stor|Storage (stor)]]''': I/O Row which converts to and from SQL (or, in theory, any other database-storage format)
** '''single integer key (k1i)''' ({{l/ver/class|ns=data/card|cK1I}}):
* '''[[/disp|Display (disp)]]''': I/O Row which converts to and from HTML (or, in theory, any other display markup)
*** '''[[/calc|Native (calc)]]''', which is used only for internal calculations (no I/O)
*** '''I/O''' ({{l/ver/class|ns=data/card/k1i|cIO}}):
**** '''[[/stor|Storage (stor)]]''': I/O Row which converts to and from SQL (or, in theory, any other database-storage format)
**** '''[[/disp|Display (disp)]]''': I/O Row which converts to and from HTML (or, in theory, any other display markup)


Once loaded with data from a given Row, a PortCard is never re-loaded with data from a different row; it always corresponds to the same row, although individual fields may be modified for output purposes. Loading a new row into a Card requires creating a new Card.
Once loaded with data from a given Row, a PortCard is never re-loaded with data from a different row; it always corresponds to the same row, although individual fields may be modified for output purposes. Loading a new row into a Card requires creating a new Card.
Line 14: Line 17:
* '''<code>data\card\{{l/ver/class|cK1I|ns=data/card}}::DoUpdate(array $arChg) : data\{{l/ver/class|cUpdateStatus|ns=data}}</code>''' : calls <code>tUpdatable::DoUpdate()</code> with a calculated $sqlWhere
* '''<code>data\card\{{l/ver/class|cK1I|ns=data/card}}::DoUpdate(array $arChg) : data\{{l/ver/class|cUpdateStatus|ns=data}}</code>''' : calls <code>tUpdatable::DoUpdate()</code> with a calculated $sqlWhere
* '''<code>data\{{l/ver/class|tUpdatable|ns=data}}::DoUpdate(array $arChg, string $sqlWhere) : {{l/ver/class|cUpdateStatus|ns=data}}</code>''' : updates the changed fields (specified in $arChg) for rows specified by $sqlWhere in the current table in the database
* '''<code>data\{{l/ver/class|tUpdatable|ns=data}}::DoUpdate(array $arChg, string $sqlWhere) : {{l/ver/class|cUpdateStatus|ns=data}}</code>''' : updates the changed fields (specified in $arChg) for rows specified by $sqlWhere in the current table in the database
==Issues==
* '''2023-03-19''' Having the calc, stor, and disp classes below k1i in the hierarchy seems like a bad idea. Maybe one or both of those splits need to be traits.

Revision as of 17:47, 19 March 2023

Navigation: PortBank : PortRow : PortCard

About

Each PortCard represents a single row of data in a particular format. The base formats (which correspond those used by PortRows) are:

  • root (caCard)
    • single integer key (k1i) (cK1I):
      • Native (calc), which is used only for internal calculations (no I/O)
      • I/O (cIO):
        • Storage (stor): I/O Row which converts to and from SQL (or, in theory, any other database-storage format)
        • Display (disp): I/O Row which converts to and from HTML (or, in theory, any other display markup)

Once loaded with data from a given Row, a PortCard is never re-loaded with data from a different row; it always corresponds to the same row, although individual fields may be modified for output purposes. Loading a new row into a Card requires creating a new Card.

Key Methods

  • caPortIORow::TransloadInput() : tell I/O row to convert its data to native format and load to calc row
  • caPortIORow::TransloadOutput() : tell I/O row to convert data in calc row to native and load to itself
  • data\rows\tDBAccess::GetMySpec() : data\spec\cQuery : fetches a Storage Card's Spec object for access to data operations
  • data\spec\cTable::Table(data\rows\cStor $o = NULL) : data\cTabloid : fetches the Table object specified by the Spec
  • data\card\cK1I::DoUpdate(array $arChg) : data\cUpdateStatus : calls tUpdatable::DoUpdate() with a calculated $sqlWhere
  • data\tUpdatable::DoUpdate(array $arChg, string $sqlWhere) : cUpdateStatus : updates the changed fields (specified in $arChg) for rows specified by $sqlWhere in the current table in the database

Issues

  • 2023-03-19 Having the calc, stor, and disp classes below k1i in the hierarchy seems like a bad idea. Maybe one or both of those splits need to be traits.