D
dev_15
Hi, just a simple question in an OO design in C++ if i am using
composition
to model a relationship i would have the object as a member(or pointer
member) of the class
ie class Airport
{
private:
CAirplane* airplane;
}
in code use as airplane->...
however if i am just using a class, then i take it wouldn't be a
member.
In this case to use the class i take it you would just declare it
locally
wherver you wanted to use the class
somemethod()
{
CAirplane airplane;
airplane->
}
Is this is a dependency relationship. I am a bit confused whats the
difference? It just
seems to be the way they are declared. Can someone clarify
composition
to model a relationship i would have the object as a member(or pointer
member) of the class
ie class Airport
{
private:
CAirplane* airplane;
}
in code use as airplane->...
however if i am just using a class, then i take it wouldn't be a
member.
In this case to use the class i take it you would just declare it
locally
wherver you wanted to use the class
somemethod()
{
CAirplane airplane;
airplane->
}
Is this is a dependency relationship. I am a bit confused whats the
difference? It just
seems to be the way they are declared. Can someone clarify