Answer the question
In order to leave comments, you need to log in
Why such a relationship between classes (Trip has Airplane)?
I am writing an OOP task (airlines) according to the TK, according to the TK, interfaces are provided that cannot be changed and the implementation should not have anything superfluous ( don`t violate your interface implementations by adding more methods etc). Stupidly following the TK, I don’t see anything complicated, but the following confuses:
interface ITrip
{
//getters like id, itinerary
public IAirplane Airplane();
}
interface IAirplane // есть 2 подвида самолетов
{
// содержит в себе коллекцию пассажиров, добавляет/удаляет пассажиров
}
Answer the question
In order to leave comments, you need to log in
Obviously, this refers to the life of the airport in dynamics. That is, not to fill it with data and shut up, but to conduct departures and arrivals, put passengers on planes, etc.
Trip is a route, and several routes can travel on one plane (for example, with landings, or a charter flight in general and several travel agencies fill the plane).
Yes, all these tasks "on OOP" with inheritance hierarchies sucked from the finger, as you put it, are "down". Do not think, there is no logic there, the author never wrote real code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question