For every flight can appear every day,so the flight object may have the date attribute,but this will lead to much duplicate information(especial persist the flight data in the table which include the flight number and date field). But if move the attribute date to segment,not include the date field in flight table will lead us can not present the equipment changed on someday . Did the exam winners include the date attribute in flight object?
i don't think that there is a flight schedule class necessary.
remember that the flight class is only the object oriented representation of the data being stored in a relational database so there is no need for having an one-to-one mapping between the classes and the entity types.
if you want to reduce redundancy in the database, you can improve a table having only flights and another table having schedule information stored in it and make sure that there is a relationship between these tables.
in the OO-representation you can read data from both tables an join them to the flight object which has flight information and schedule data as well.
Joined: May 26, 2005
but I think flight and flight schedule(flight timetable) are two different concept,when mention to flight we mean from where to where,but flight schedule mean what time the flight will run?
Ali Reza Hosseini
Joined: Apr 28, 2005
chao, your concept correct ... what I want to mention is, that there not necessarily has to be a flight schedule class, you can handle it with only one class.
as you also have surely experienced it already there are always many different ways to solve the same problem.
subject: mazed by the relationship between flight and date