Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Schedule movement of car between offices in a car rental scenario

Schedule movement of car between offices in a car rental scenario

Scheduled Pinned Locked Moved Design and Architecture
questiondesigndiscussion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Homer77
    wrote on last edited by
    #1

    Hi, I need some thoughts on a design for at car rental service. Multiple offices exists in the company. An office can move a car from its car pool to another office if demands in their region changes. A car movement can be based on seasonal reasons and therefore a move can be scheduled in advance. How do I solve the double relationship that would exist when a scheduled move has be invoked? The car still belongs to office 1 until a certain date. But the car also belongs to office 2 when that date has been reached. Meaning that office 1 can still lease it out until that date and office 2 can start leasing it out from that date. My first thought is to create a many to many relationship like this. CARS -------- ID | Name 1 | Ford STATION --------- ID | Name 1 | NY 2 | BOS STATION_CARS ------------------------------------------------------- StationID | CarID | DateAvailableFrom | DateAvailableTo 1 | 1 | 01.01.2011 | 01.11.2011 2 | 1 | 02.11.2001 | 01.02.2012 But i also need to register the "scheduled move" object, making it visible to the staff and deleteable, in another table. Seems kind of messy so i wonder how others have dealt with this scenario. Any thoughts would be much appreciated.

    M L 2 Replies Last reply
    0
    • H Homer77

      Hi, I need some thoughts on a design for at car rental service. Multiple offices exists in the company. An office can move a car from its car pool to another office if demands in their region changes. A car movement can be based on seasonal reasons and therefore a move can be scheduled in advance. How do I solve the double relationship that would exist when a scheduled move has be invoked? The car still belongs to office 1 until a certain date. But the car also belongs to office 2 when that date has been reached. Meaning that office 1 can still lease it out until that date and office 2 can start leasing it out from that date. My first thought is to create a many to many relationship like this. CARS -------- ID | Name 1 | Ford STATION --------- ID | Name 1 | NY 2 | BOS STATION_CARS ------------------------------------------------------- StationID | CarID | DateAvailableFrom | DateAvailableTo 1 | 1 | 01.01.2011 | 01.11.2011 2 | 1 | 02.11.2001 | 01.02.2012 But i also need to register the "scheduled move" object, making it visible to the staff and deleteable, in another table. Seems kind of messy so i wonder how others have dealt with this scenario. Any thoughts would be much appreciated.

      M Offline
      M Offline
      Matt U
      wrote on last edited by
      #2

      I am no expert with this stuff. But I would personally think that a "Scheduled Moves" table (a junction table) would be the best solution. I say this based on what I have learned over the past several months. Scheduled Moves SourceStationID, DestinationStationID, CarID, DateEffective Those are the fields I would see in the junction table. Just my opinion.

      djj55: Nice but may have a permission problem Pete O'Hanlon: He has my permission to run it.

      1 Reply Last reply
      0
      • H Homer77

        Hi, I need some thoughts on a design for at car rental service. Multiple offices exists in the company. An office can move a car from its car pool to another office if demands in their region changes. A car movement can be based on seasonal reasons and therefore a move can be scheduled in advance. How do I solve the double relationship that would exist when a scheduled move has be invoked? The car still belongs to office 1 until a certain date. But the car also belongs to office 2 when that date has been reached. Meaning that office 1 can still lease it out until that date and office 2 can start leasing it out from that date. My first thought is to create a many to many relationship like this. CARS -------- ID | Name 1 | Ford STATION --------- ID | Name 1 | NY 2 | BOS STATION_CARS ------------------------------------------------------- StationID | CarID | DateAvailableFrom | DateAvailableTo 1 | 1 | 01.01.2011 | 01.11.2011 2 | 1 | 02.11.2001 | 01.02.2012 But i also need to register the "scheduled move" object, making it visible to the staff and deleteable, in another table. Seems kind of messy so i wonder how others have dealt with this scenario. Any thoughts would be much appreciated.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Homer77 wrote:

        Seems kind of messy so i wonder how others have dealt with this scenario

        Normalization, to BNF (3NF+); following those steps always leads to a decent relational design.

        Bastard Programmer from Hell :suss:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups