<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Object oriented REA using DBQUITY</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jesper Kiehn</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Lars Hammer</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>EG A/S</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dbquity ApS</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Copenhagen</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Denmark</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hammer Software</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dbquity ApS</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Frederiksberg</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Denmark</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>In this presentation, we introduce the software platform, Dbquity [9], and some learning points about REA models. Dbquity lets you declaratively model data structure and express derived information at the domain expert's level of abstraction without over-specifying or repeating knowledge using a dedicated declarative1 language, which centers on the notions of entity and association and single inheritance with powerful member-specialization capabilities, and lets you work on multiple levels of abstraction factoring out domain-specific, reusable libraries. The language abstracts away all implementation details, and the model declared is executed directly by the Dbquity runtime without any need for further artefacts. Design goals for Dbquity include, that based on a single inheritance combined with expressive, intuitive constraints, the language must support both basic and more advanced REA patterns such as policy and valuation whilst aiming to be if not writable, then at least readable for non-programmers using a no/low-code approach. Further, the system must be able to generate the required set of reports from the model itself in as simple a way as possible. We aim to open source the specification of the language itself and keep the core tooling and runtime implementations closed source. The first2 incarnation of the runtime targets a simple, ubiquitous twotier topology using cloud-based storage and mobile phones aiming to make it as effortless as possible for modelers to distribute Dbquity models and for consumers to use the models. Our work includes several examples to make it clear how to implement REA patterns using Dbquity, and we hope to get feedback on the presented models, the language, the tooling, and the current scope.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>1.1</p>
      <p>The Dbquity language introduced by an example
The example of (a sketch of) a REA library and a DAAS design referencing that library in figure 1 on
the following two pages shows how the Dbquity language uses semantic indention such that text
indented under a model element is either properties of that model element or nested elements or
members of that same model element, meaning that the Agent entity will have a field of type text
called Name and the identity of the Agent will be the Name.</p>
      <p>In general, a type followed by a name declares an element or a member of that type, and properties
are declared by their name followed by a colon and the property value, which is often an expression
over the model.</p>
      <p>Dbquity stores data in a hierarchy of entities rooted by areas. An area is itself a (special kind of)
entity. Only concrete (not abstract) entities declared inside an area will be instantiable at runtime.</p>
      <p>Note how the name of a previously declared entity can be used as a keyword for declaring a
specialized entity. For example, the line Agent Producer, declares the Producer entity in the
Sales area specializing the Agent entity of the REA library.</p>
      <p>library REA
entity Resource
text Name
identity: Name
decimal Price
entity Event
date When
decimal Amount
entity Agent
text Name
identity: Name
design DaaS
references: REA
area Sales</p>
      <sec id="sec-1-1">
        <title>Agent Producer</title>
      </sec>
      <sec id="sec-1-2">
        <title>Agent Lessor</title>
        <p>decimal ComputerPurchaseTotal</p>
        <p>expression: Lessor@Sale.sum(Amount)
integer ComputersBorrowed</p>
        <p>expression: Lessor@ComputerBorrowSale.count(Active)</p>
      </sec>
      <sec id="sec-1-3">
        <title>Agent User link Employedby entity: Lessor</title>
      </sec>
      <sec id="sec-1-4">
        <title>Resource Computer</title>
        <p>link User</p>
        <p>expression: Computer@ComputerBorrowSale.last(Active).User
link Soldto
entity: User
expression: Computer@ComputerBorrowSale.last(Sold).User</p>
      </sec>
      <sec id="sec-1-5">
        <title>Resource TransportService</title>
      </sec>
      <sec id="sec-1-6">
        <title>Event Sale link Producer link Lessor link Computer</title>
      </sec>
      <sec id="sec-1-7">
        <title>Event SalePayment link Producer link Lessor link Sale</title>
      </sec>
      <sec id="sec-1-8">
        <title>Event Transport</title>
        <p>link Producer
link Lessor
link TransportService
link Computer
Listing 1: Example of a Dbquity design referencing a library (continues on next page)
Listing 1: Example of a Dbquity design referencing a library (continued from previous page)</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>Event ComputerBorrowSale link Lessor link User link Computer date LatestReturn default: When.addyears(3) boolean Active expression: not (Returned or Sold) boolean Returned expression: ComputerBorrowSale@Return.any() boolean Sold expression: ComputerBorrowSale@UserPayment.any() step IssueNotice guard: today() &gt;= LatestReturn.adddays(-10) behaviour: add(Notice, Due: max(LatestReturn,today</article-title>
          ()), Amount: Amount, Note:
          <article-title>"Please return PC by "|max(LatestReturn,today())| " or pay "|Amount|"</article-title>
          <source>USD.")</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>William</given-names>
            <surname>E. McCarthy</surname>
          </string-name>
          ,
          <string-name>
            <surname>G. L. Geerts “</surname>
          </string-name>
          <article-title>An ontological analysis of the economic primitives of the extendedREA enterprise information architecture”</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>William</given-names>
            <surname>E. McCarthy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. L.</given-names>
            <surname>Geerts</surname>
          </string-name>
          <article-title>: “Policy-Level Specifications in REA Enterprise Information Systems”</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>[3] Valueflows: https://www.valueflo.ws/</mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Cheryl</given-names>
            <surname>Dunn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. Owen</given-names>
            <surname>Cherrington</surname>
          </string-name>
          , Anita Hollander:
          <article-title>Enterprise Information Systems: A Pattern-Based Approach</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Cheryl</given-names>
            <surname>Dunn</surname>
          </string-name>
          : REA Accounting Systems
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Frederik</given-names>
            <surname>Gailly</surname>
          </string-name>
          ;
          <article-title>Wim Laurier; Geert Poels: Positioning and Formalizing the REA Enterprise Ontology</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>James</given-names>
            <surname>Perry</surname>
          </string-name>
          , Richard Newmark:
          <article-title>Building Accounting Systems Using Microsoft Access 2013</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <source>[8] ISO/IEC 15944-4</source>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>[9] http://www.dbquity.com/</mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>[10] https://grpc.io/</mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Hruby</surname>
            ,
            <given-names>Pavel.</given-names>
          </string-name>
          (
          <year>2006</year>
          ).
          <article-title>Model-Driven Design Using Business Patterns</article-title>
          .
          <volume>10</volume>
          .
          <issue>1007</issue>
          /3-540-30327-2.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>