Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2011
    Posts
    1

    Angry Car service - domain model?

    First of all I know that there is no Car, Model, Manufacture... tables that I probably should make, but that is not a problem right now.

    I must say that I have already made database and relational model looks like this (I simplified it, to concentrate on important), but I need to draw a conceptual (domain) model of this:

    Client (clientID, name, surname, telephone)

    Address (clientID, number, street, cityZipCode)

    City (cityZipCode, cityName)

    Visit (clientID, visitDate, totalPrice)

    Service (serviceID, serviceName)

    Criteria (criteriaName, size, measureUnit)

    ServicePriceCriteria (serviceID, criteriaName, size, price)

    VisitItem (clientID, visitDate, serviceID, criteriaName, size, quantity)

    My the biggest problem was how to provide that ONE service can have different prices for different criteria.

    i. e. Oil Changes for the truck costs 15€. For suv same service costs 8€.... Other example is when price depends on the size of the wheel. For 14 inches wheel some service costs 10€ and the same service for 17 inches wheel costs 15€.

    So for the first example I have: Service(123, 'Oil Changes'), Criteria('typeOfVehicle', 'Truck', null), ServicePriceCriteria(123, 'typeOfVehicle', 'Truck', 15)

    Service(123, 'Oil Changes'), Criteria('typeOfVehicle', 'SUV', null), ServicePriceCriteria(123, 'typeOfVehicle', 'SUV', 8)

    For the second example it looks like this: Service(124, 'Some Service'), Criteria('Size of wheel', '14', inches), ServicePriceCriteria(124, 'Size of wheel', '14', 10)

    Service(124, 'Some Service'), Criteria('Size of wheel', '17', inches), ServicePriceCriteria(124, 'Size of wheel', '17', 15)

    I hope so you realized what was my idea. I wanna to ask you is this solution acceptable at all? And is it domain model from atachment correct domain model of this database?
    Attached Thumbnails Attached Thumbnails conceptual.png  
    Last edited by BojanSM; 10-13-11 at 06:33. Reason: I forgot to mark foreign key.

  2. #2
    Join Date
    Oct 2011
    Location
    Connecticut
    Posts
    3
    I'm just learning too, so this might not be an appropriate solution. How about using supertype and subtypes with discriminators?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •