Previous | Next
WireHose Developers Guide

Affiliate-based inheritance

The most prevalent inheritance model used in WireHose is that of affiliate-based inheritance. This approach is used by WHTag, WHUser, WHTagFetcherFactory, WHDrillFetcherFactory and WHQualifierFetcherFactory, and can easily be used in your own resource and channel factory entities.

In this approach, you define an attribute on your base entity called "affiliate". This attribute will be used with a restricting qualifier to identify subentities. The restricting qualifier for the base entity is "affiliate = nil", and the restricting qualifier for an affiliate-based subentity would be "affiliate = affiliateName". For example, given a base entity named "Picture" and an affiliate of "Seattle", the subentity would be named "SeattlePicture" and the restricting qualifier would be "affiliate = 'Seattle'".

As an alternative to the affiliate attribute, you can use an attribute called "entityType". If the base entity has an attribute named entityType, the restricting qualifier would be "entityType = entityName". This is the approach used by WHTag.


Previous | Next