Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Containment Example

This example shows how to configure a concept `Car` to contain a concept `Wheel` by adding a `ContainedConcept` property `Wheels`, whose value is an instance of the concept `Wheel`.

The `Wheels` property provides the link between the container and contained concept:

`Car` (Concept) — `Wheels` (property) — `Wheel` (Concept)

The concept `Car` contains four instances of the contained concept `Wheel`, so you define the property as an array. The concept `Car` could also contain other concepts, such as `Door` and `Engine`, defined in a similar way using `ContainedConcept` properties.

However, the contained concepts — `Wheel`, `Door`, and `Engine` — cannot be contained by any other concept type. They can only be contained by the `Car` concept. For example, the concept `Wheel` cannot be contained in the concept `Motorbike`, if it is already contained by the concept `Car`.

Tip: A container concept can link to a contained concept using only one `ContainedConcept` p`roperty`. You can use inheritance, however, to achieve a result similar to that gained by the general programming technique of linking to multiple contained class properties. Suppose you extend the concept `Wheel` by creating child concepts `CarWheel` and `MotorcycleWheel`. You can then use `CarWheel` as the concept contained by `Car`, and `MotorcycleWheel` as the concept contained by `Motorcycle`. Rules that apply to `Wheel` also apply to `CarWheel` and `MotorcycleWheel`, because of inheritance.

Depending on your needs, another option would be to use a reference relationship instead of a containment or inheritance relationship.

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.