Types

From Sunhill Framework Documentation
Revision as of 18:15, 19 September 2024 by Klaus (talk | contribs) (created articles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Of cause you can implement an AbstractProperty and overwrite all necessary methods. But the sunhill framework defines some predefined types and semantics.

The difference between types and semantics

A type is a basic format as you know from any programming language. So you have types like integer or string.

A semantic is the idea behind a value. A typical semantic is temperature or capcity. The semantic has always a type as a parent because a temperature would be always a float and a name is always a string.

Long story short: A semantic is a child of a type.

The basic types

Integer

Take a integer number like 1, -4 or 1234.

Float

Takes a floating point numer like 1.2, -0.2, 3.

Boolean

Takes only a boolean value like true or false.

Date

Takes a date as value like 2004-10-23.

DateTime

Takes a timestamp value like 2004-10-23 12:22:10.

Time

Take a time value like 12:22:10

Enum

Take one of some predefined string values.

String

Takes a sequence of characters like "Hello this is a string".

Text

The same a string besides that it can take any count of characters.

Blob

Takes a sequence of bytes (not only readable characters).

The complex types