Tutorial: Statements

When you’re finished defining the nouns and verbs for your app, as a next step you can write statements that connect these nouns via verbs. A statement is a sentence that is considered to be generally true in your app, and is therefore written in plural. In Hapsah, a Statement always has the structure of three parts:

  • Subject: noun representing the entity or descriptor that acts as the subject of the sentence.
  • Relationship: verb representing the connection between the subject and the object of the sentence.
  • Object: noun representing the descriptor or attribute that acts as the object of the sentence.

There are three kinds of statements you can write in order to:

  • Associate two entities: by connecting an entity as subject with another entity as object via an association relationship (e.g. Customers use Shopping carts).
  • Characterize an entity: by connecting an entity as subject with a descriptor or attribute as object via an attribution relationship (e.g. Grocery products are referred to by Product names).
  • Construct a descriptor: by connecting a descriptor as subject with an attribute as object via a consist of relationship (e.g. Addresses consist of Street names).

Example app: Grocery store

For our grocery store app we need the following statements.

Constructing Descriptors

Address

  • Addresses consist of Street names
  • Addresses consist of House numbers
  • Addresses consist of City names

Full name

  • Full names consist of First names
  • Full names consist of Surnames

Price

  • Prices consist of Currencies
  • Prices consist of Amounts

Characterizing Entities

Customer

  • Customers live at Addresses
  • Customers are referred to by Full names

Product

  • Grocery products are referred to by Product names
  • Grocery products are referred to by Product descriptions
  • Grocery products are valued at Prices

Shopping cart

  • Shopping carts total up to Prices
  • Shopping carts are reduced to Prices

Store

  • Grocery stores are located at Addresses

Associating Entities

  • Grocery stores offer Grocery products
  • Grocery stores offer Shopping carts
  • Customers use Shopping carts
  • Shopping carts contain Grocery products
  • Customers check out Shopping carts