Reference Selector

Hello, I have a queation. I have an Entity Camping. One of its atrributes is Naam (name). I have another entity Afstand (distance). In that entity I want to store the distances between the different Campings.  I created pages for the Afstand Entity. When I want to make a new Afstand the page look like this. When I choose the first Camping, it automatically sets the second camping to the same camping. But I want to be able to choose a different camping. I set the reference between Camping and Afstand Many – to – Many, but apparently that doesn't work. Who could help me out?   For those who will read my question later on, I changed my Domain model to: And it worked!
2 answers

You have the reference set selectors set to the same association, so you're filling the many-to-many with one camping object in one selector and the second one is updated with the same value, since it's the same association.

I would consider using two associations many-afstanden-to-one camping. You add a reference selector on association1 to camping1 and another to camping2 to over the second association. Then on change or on save or whatever you can retrieve both campings and calculate the distance and set it in the afstand object.


Martin suggests the following:

Though, when reviewing your domain model and trying to understand the whole use case. I do have the impression you want to create a travel plan, having multiple stops at different campings. Which could be more then 2 campings. Right? if not then stop reading. If right, continue.


In that case

  1. you want to be able to select multiple campings
    > Select one camping with specific characteristics
  2. Distance/time calculation between two campings visited after each other.
    > Specific characteristic between 2 campings
  3. You want to make a reservation for that specific camping. 
    > Specific characteristic for a selected camping (not of A camping)
  4. Want to know when you will arrive and leave a specific camping
    > Specific characteristic for a selected camping (not of A camping)

Which will lead to this domain model where you have a travel plan, which has a list of CampingSelections.

This camping selection object contains the details of how a camping relates to your travel plan, like:

  1. Sequence of visiting
  2. Reservation status
  3. Arrival
  4. Departure
  5. Distance from previous camping (1 sequence lower)
  6. etc...

And ofcourse a list of Campings



When you did take the Rapid developer course online, then this relates to the used case of the training management

A training event (TravelPlan) has a list of Registrations (CampingSelection) each registration is made for a specific trainee (Camping)

Same domain model, different process, different information you need. same way of creating data.