educative.io

Educative

Flight vs Flight Instances clarification

Hi,
I am not able to understand the difference between flight and flight instance class. Could anyone please help?


Type your question above this line.

Course: https://www.educative.io/collection/5668639101419520/5692201761767424
Lesson: https://www.educative.io/collection/page/5668639101419520/5692201761767424/6235413119238144

If i am right, does it mean that one flight can have a occurence on a day which is denoted by flight instance and the same flight can happen on many day, that’s why?

Hi @Anupam_Pandey

Let’s understand this example like this: suppose a Flight is a Library and FlightInstance is a Book. A library class has many books, similarly, there can be multiple flight instances. And regarding your concern about “flights happening on many days”, that is covered by the CustomSchedule and class.

Hope this explanation helps, feel free to drop in more queries.
Happy learning.

Thanks Dian, so, flight instance means one occurence of the flight,right?