-
Notifications
You must be signed in to change notification settings - Fork 0
Node
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.
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.
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
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.
We have 3 top level categories of node types, and each can have its own sub-node types.
- React
- Tree
- Ref
- Model
- Schema
Footer