Hi Chris,

I can try. As Philip says in the documentation inheritance is used
when you have objects that are similar and share common variables and
methods. An interface is used when you have two different classes that
are very different but need to share one or more functions or
variables.

What this gains you is you don't have a lot of extra methods and
variables hanging around that you don't need. Keep in mind every
variable you create in a class gets loaded onto the heap in memory
that could be used for something else. There is no sense inheriting a
super class if all you need is one variable and related functions that
interact with that variable. Instead you can move that variable and
related functions to an interface that can be shared between the two
classes without dumping a bunch of unnecessary variables onto the
heap. Does that make sense?


On 1/21/12, Christopher Bartlett <themusicalbre...@gmail.com> wrote:
> I'd post this question on the Blastbay forum, but I haven't received my
> approval yet.
>
>
>
> What is the use case for an interface v. classic inheritance in object
> definitions?  I've looked through the BGT documentation and I sort of
> understand that you'd use an interface when you have some dissimilar objects
> that share a method, like the birds and musical instruments both being sound
> sources, to go with the example in your language tutorial.  But I don't
> understand what this gains me in terms of programming convenience or code
> compaction.  Could you clarify this a bit?
>
>
>
>                 Christopher Bartlett
>
>
>
> ---
> Gamers mailing list __ Gamers@audyssey.org
> If you want to leave the list, send E-mail to
> gamers-unsubscr...@audyssey.org.
> You can make changes or update your subscription via the web, at
> http://mail.audyssey.org/mailman/listinfo/gamers_audyssey.org.
> All messages are archived and can be searched and read at
> http://www.mail-archive.com/gamers@audyssey.org.
> If you have any questions or concerns regarding the management of the list,
> please send E-mail to gamers-ow...@audyssey.org.
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://mail.audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to