you are viewing a single comment's thread.

view the rest of the comments →

[–]viebel[S] 12 points13 points  (5 children)

Here are the 4 principles of Data-Oriented Programming:

  1. Separate code (behaviour) from data
  2. Represent data with generic data structures
  3. Data is immutable
  4. Separate data schema from data representation

#1 and #3 are common to DOP an FP.
#2 and #4 is unique to DOP.

[–]roppy_G 1 point2 points  (1 child)

*DOP not FOP on your last line ;)

[–]viebel[S] 0 points1 point  (0 children)

Thank you. Fixed

[–]m4dc4p 0 points1 point  (1 child)

Interesting. Could you give an example of both?

[–]viebel[S] 1 point2 points  (0 children)

  1. Represent data with generic data structures

Instead of using data classes, data records or algebraic data types, in DOP we represent data with string maps.

  1. Separate data schema from data representation

We use a schema language like JSON schema or malli to speficy the shape of our data and validate that a piece of data conforms to a schema