in

The ORM Foundation

Get the facts!

Connecting entities, values or facts on different pages

Last post 03-03-2010 15:59 by Matthew Curland. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-03-2010 4:39

    Connecting entities, values or facts on different pages

    Hey

    I have created several pages and now I want to have for some entities same facts. Lets say for example "Time" with values "arrival and departure time". NORMA off-course doesn't allow to create entity or value with the same name, but Time is always same, so there is no point of creating entities like "Time1, Time2, etc". 

    If I use tha same "Time" entity then on the previus page the entity and fact connectors just dissapear.

    Anyone with more experience have a solution for that? And I dont want to create everything on one page.

    Thanks


  • 03-03-2010 5:29 In reply to

    Re: Connecting entities, values or facts on different pages

    From what you have said, I don't have enough information to see why your entity and fact connectors should disappear.

    However, I suggest that you consider modeling what seem to me to be "more elementary" facts about what the trains are doing and then have your "schedule" as a report.

    For example:

    Train(.id) arrives at Station(.name) at Time()
    Train(.id) departs from Station(.name) at Time()

    If you set the datatype of "Time" to be date-time then you can create a database that explicitly contains each instance of an arrival and departure for each station on each day.
    Any "schedules" are then just reports that are run against the detailed instances in the database.
    This approach has added benefits for example:  "dynamic online schedules" can be very accurate merely by changing the rows in the table.

    For example if a train departs late and is unable to make up time, then a predictive algorithm could be run to update the data instances.

    Ken 

  • 03-03-2010 6:13 In reply to

    Re: Connecting entities, values or facts on different pages

    Hey

    If I understand correctly then you suggest that I should use same "time" entities for each ORM Norma page. For example:

    Page 1:

    Train(.id) arrives at Station(.name) at Time()
    Train(.id) departs from Station(.name) at Time()

    Page 2:

    Airplane(.id) arrives at Airport(.name) at Time()
    Airplane(.id) departs from Airport(.name) at Time()

    But in this case I can not use subset constraint, that if train departs then it must arrive. Even though we might assume that this is an always a case, but if there could be time events with possibility to not have end time, then maybe I need to force this constraint...if it does make sense.

    And in case Airplanes are using different schedules then I still need to create "Time2" datatype.

    V.K


  • 03-03-2010 7:54 In reply to

    Re: Connecting entities, values or facts on different pages

    If you make both of the "Train" roles mandatory then there is an implied equality constraint.
    This would say

    Train arrives at Station at Time.
    For each Train and Station,
    that Train arrives at that Station at at most one Time.
    This association with Train, Station provides the preferred identification scheme for TrainArrivesAtStationAtTime.
    Each Train arrives at some Station at some Time.

    In other words if a train arrives then it must depart.
    Of course a train must depart from its "start station" and so there will be no arrival at that station.
    Similarly, the train will arrive at its "last station" and so there will be no departure from the last station.

    One way to handle this is to define StartStation, EndStation and WaypointStation as subtypes of Station.
    Then for each WaypointStation you could just put a mandatory constraint on the "Train" role in the fact Train(id) arrives at WaypointStation(.name) at Time()

    Subset, Equality and Exclusion constraints are explained in detail on pages 224- 238 of the BBB.

    I don't see the need to use more than one Time() object. (Even for Aircraft flights Bus times, Ferry times and other time related events.)
    One of ORM's strengths is that you only have to define each Object once.

    Of course in a"muliti-mode-transport" model you may have to add features that cater for different time zones... 

    Ken

  • 03-03-2010 15:59 In reply to

    Re: Connecting entities, values or facts on different pages

    ORM objects are not bound to any particular page. The diagrams are just a view on the underlying model.

    There are multiple ways to get a shape for the same underlying element displayed in multiple locations in the model. You can tell if an element is represented by multiple shapes by a shadow to the right and bottom of the shape, and you will see additional context menu items to select different representations of the element.

    • To duplicate the shape on the same page, drag the shape while holding down the control key.
    • To copy a shape between pages
      • Show one page in the Diagram Spy window and one in the document window and drag between them
      • Show multiple windows on the same document and drag between them. This is documented in the Window Management in Visual Studio section of the readme.htm file installed with NORMA.
    • Drag an element from the Model Browser unto a diagram to create a new shape for it.

    Note that for multiple shapes for the same element on one diagram, connections between elements automatically choose the closest shape (the algorithm is slightly more detailed than that, I'll expand if you like). This can cause some issues with undesirable subtype connections, which are generated automatically. You can display of subtype and supertype lines from any ObjectType that is a sub or super type using the 'DisplayRelatedTypes' property.

    -Matt

     

Page 1 of 1 (5 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service