Skip to content
Webber Wang edited this page Sep 20, 2020 · 1 revision

Entity & Value object

Entity & Value Object are used as domain models, they help us encode real world objects with behavior into code. They both contain behavior & business logic specific to your domain. The only difference between Entity & Value Object is that Value Object doesn't have its own identity.

Data Transfer Object (DTO)

A DTO is a class representing some data with no logic in it. Its sole purpose is to transfer data between different layers of the application.

Node Type

Everything in our application is a Node, from ui components to schema.

We have the Node or NodeEntity class, which contains methods like addChild & addParent. For functions that take in Node as a parameter, most of the time it only requires Node as a Data Transfer Object (DTO). We access type, id, children, but don't require any methods on NodeEntity.

I & A

I is for input, A is for working type or your transformed data.

Our json data is I & after processing becomes A. We set default field values & check for input data validity. Processing happens during tree traversal.

3 major node types

We have 3 top level categories of node types, and each can have its own sub-node types.

  • React
  • Tree
    • Ref
  • Model
    • Schema
Clone this wiki locally