Headline

Construction of data according to variants

Note

Data variation is not an established term, but it naturally arises as a generalization and dualization of existing notions that are used in data modeling and programming. Common forms of data variation are based on variant types and type generalization. For clarity, the general term data variation is used on this wiki, whenever appropriate.

Description

Data variation entails data variants, of which one must be chosen when actual data is constructed. The data variants may be specified, for example, as a variant type or as OO types related to a common base type through type generalization. Data variation may be seen as a principle means of going beyond data composition.

Illustration

The following Language:Haskell-based data model for the @system leverages data variation in one spot and otherwise data composition. The data model is based on algebraic data types. The data type for subunits declare two constructors to model different types of subunits, as needed for aggregating subunits of departments.

data Company = Company Name [Department]
data Department = Department Name Manager [SubUnit]
data Employee = Employee Name Address Salary
data SubUnit = EUnit Employee | DUnit Department
type Manager = Employee
type Name = String
type Address = String
type Salary = Float

The snippet originates from Contribution:haskellVariation.


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.