In distributed computing, a discriminator is a typed tag field present in OMG IDL discriminated union type and value definitions that determines which union member is selected in the current union instance. Unlike in some conventional programming languages offering support for unions, discriminator in IDL is not identical to selected field name. Here is an example of IDL union type definition: union Register switch (char) { case 'a': case 'b': short AX; case 'c': long EAX; default: octet AL;};
Attributes | Values |
---|
rdf:type
| |
rdfs:label
| - Discriminator (cs)
- Discriminator (en)
|
rdfs:comment
| - V distribuovaném programování slouží discriminator jako identifikátor entity (tzv. tag), který vyjadřuje, o jaký typ entity se jedná na základě předem definovaného výčtu, který určuje samotný systém (například UNION nebo ENUM typ v relační databázové tabulce). Discriminator se používá pro převod objektového návrhu entit v rámci programovacího jazyka do tabulkové podoby, kdy potřebujeme zachovat informaci o názvu původního typu entity v programovacím jazyce. Příklad:
* name
* description
* pages_count
* author
* system
* battery_capacity
* discriminator (cs)
- In distributed computing, a discriminator is a typed tag field present in OMG IDL discriminated union type and value definitions that determines which union member is selected in the current union instance. Unlike in some conventional programming languages offering support for unions, discriminator in IDL is not identical to selected field name. Here is an example of IDL union type definition: union Register switch (char) { case 'a': case 'b': short AX; case 'c': long EAX; default: octet AL;}; (en)
|
dcterms:subject
| |
Wikipage page ID
| |
Wikipage revision ID
| |
Link from a Wikipage to another Wikipage
| |
sameAs
| |
dbp:wikiPageUsesTemplate
| |
has abstract
| - V distribuovaném programování slouží discriminator jako identifikátor entity (tzv. tag), který vyjadřuje, o jaký typ entity se jedná na základě předem definovaného výčtu, který určuje samotný systém (například UNION nebo ENUM typ v relační databázové tabulce). Discriminator se používá pro převod objektového návrhu entit v rámci programovacího jazyka do tabulkové podoby, kdy potřebujeme zachovat informaci o názvu původního typu entity v programovacím jazyce. Příklad: Mějme 3 entity reprezentující různé typy produktů v internetovém obchodu, které mezi sebou zároveň definují závislosti pomocí dědičnosti: class Product { public $name; public $description;}class Book extends Product { public $pagesCount; public $author;}class Phone extends Product { public $system; public $batteryCapacity;} Například v jazyce PHP můžeme velice jednoduše instancovat objekt Book, která reprezentuje produkt s knihou a přidává informaci o počtu stran a autorovi. Pokud však budeme chtít všechny typy produktů (základní produkt, knihu a telefon) uložit do relační databáze, můžeme vytvořit pouze jednu tabulku product, která bude mít následující sloupce:
* name
* description
* pages_count
* author
* system
* battery_capacity
* discriminator Sloupec discriminator v tomto případě bude nést hodnoty product, book nebo phone v závislosti na aktuálně uložené entitě. Úkolem knihovny pro obsluhu databáze v konkrétním jazyce (například Doctrine) je pochopit nastavení Discriminatoru a podle toho vytvořit instance správné entity s ohledem na předem definovaný seznam. (cs)
- In distributed computing, a discriminator is a typed tag field present in OMG IDL discriminated union type and value definitions that determines which union member is selected in the current union instance. Unlike in some conventional programming languages offering support for unions, discriminator in IDL is not identical to selected field name. Here is an example of IDL union type definition: union Register switch (char) { case 'a': case 'b': short AX; case 'c': long EAX; default: octet AL;}; Effective value of the Register type may contain AX as selected field, but discriminator value may be either 'a' or 'b' and it is stored in memory separately. Therefore, IDL logically separates information about currently selected field name and union effective value from information about current discriminator value. In the example above, discriminator value may be anything of the following: 'a', 'b', 'c', as well as all other characters belonging to the IDL char type, since the default branch specified in the example Register type allows use of the remaining characters as well. (en)
|
gold:hypernym
| |
prov:wasDerivedFrom
| |
page length (characters) of wiki page
| |
foaf:isPrimaryTopicOf
| |
is Link from a Wikipage to another Wikipage
of | |
is foaf:primaryTopic
of | |