Developer Docs

Source & Target optional

The properties panel includes the switches Target Optional and Source Optional. These properties allow you to toggle relationship dependencies between two entities.

What is a relationship dependency?

A relationship dependency describes whether an entity is dependent on or independent of an associated entity.
Let’s explore three different scenarios that use relationship dependencies.

Scenario 1: Target Optional

Let’s assume we have a diagram where a “Owner” can own many “Cars”, denoted in the diagram below.

Image

In our fictional scenario we have a rule that any car must have an owner. This would mean that a Car has a dependent relationship with an Owner. In other words, an Owner may or may not own a Car but a Car must have an Owner.

If we say the source is an Owner and the Car is the target, the relationship would be target optional and would resemble the image below.

Image

Scenario 2: Source Optional

This time, the rule is that a Car is not required to have an Owner, but everyone must own a Car. This would mean that a Car has an independent relationship with an Owner. In other words, an Owner must have a Car but a Car may have an Owner.

This relationship would be source optional as the Owner is still the source, and would resemble the image below.

Image

Scenario 3: Source and Target Optional

In the final scenario, Cars are not required to have an Owner and an Owner is not required to have a Car. This means that an Owner and a Car have an independent relationship to each other. An Owner may or may not have a Car and a Car may or may not belong to an Owner. The relationship dependency in this situation would be both target optional and source optional and would be represented by the image below.

Image

Was this article helpful?

Thanks for your feedback!

If you would like to tell us more, please click on the link below to send us a message with more details.

Tool:

Generate

Iterate

Bot:

C#Bot

SpringBot

On this page

New to Codebots?

We know our software can be complicated, so we are always happy to have a chat if you have any questions.