Headline

Composition of compound data from parts

Note

Data composition is not an established term, but it naturally arises as a generalization of existing notions that are used in data modeling and programming. A common form of data composition is object composition, which is actually sometimes also defined in a broad enough sense, not to be limited to objects in the sense of OO programming. For clarity, the general term data composition is used on this wiki, whenever appropriate.

Description

Data composition entails component entities (e.g., primitive data or previously composed data) and compound entities (e.g., objects, tuples, or records). Composition means that the components (say, the parts) are combined to form a compound (say, a whole). A principle means of going beyond data composition is to leverage data variation.

Illustration

The following Language:Haskell-based data model for the @system leverages data composition systematically. The data model is based on algebraic data types. The data types for companies, departments, and employees declare a single constructor to serve for data composition. Basic types for numbers and strings are used for some components. List types are also used.

data Company = Company Name [Department]
data Department = Department Name Manager [Department] [Employee]
data Employee = Employee Name Address Salary
type Manager = Employee
type Name = String
type Address = String
type Salary = Float

The snippet originates from Contribution:haskellComposition.


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.