April 26, 2024, 07:42:57 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


question about classes and subclasses

Started by John S, February 14, 2007, 11:55:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

John S

What is the difference execution wise between the following:

First example

class SomeBaseClass
{
  // a lot of something here
}

class SomeChildClass : SomeBaseClass
{
  // some more stuff here
}



Second example

class SomeBaseClass
{
  // a lot of something here
}

class SomeOtherClass
{
  SomeBaseClass BaseClassObject;

  // some more stuff here
}


In both examples there is inheritance, etc.  Which codes more efficiently?  This is relevant to the Vector/Array stuff I've been working on.
John Siino, Advanced Engineering Services and Software

Ionic Wind Support Team

Both examples are not inheritance.  Only the first one is.

In the second example you have a member variable of some other class, which is slightly longer codewise when you execute a method in the member variable.
Ionic Wind Support Team

John S

John Siino, Advanced Engineering Services and Software