Re: [Audyssey] For Philip re: BGT interfaces vs inheritance.
Thank you both for your responses. Thomas, yes that was quite clear. Philip, I am themadviolinist on the forum as on audiogames.net. 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.
[Audyssey] For Philip re: BGT interfaces vs inheritance.
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.
Re: [Audyssey] For Philip re: BGT interfaces vs inheritance.
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.
Re: [Audyssey] For Philip re: BGT interfaces vs inheritance.
Hi Christopher, The use case is if you have a lot of classes that should implement the same interface, and you want to be able to work with this given interface without needing to know which type of class you're actually dealing with as long as that interface is present. Personally I don't use this feature very often, though. What is the username that you registered on the forum? I will go and approve it. Kind regards, Philip Bennefall - Original Message - From: Christopher Bartlett themusicalbre...@gmail.com To: 'Gamers Discussion list' gamers@audyssey.org Sent: Saturday, January 21, 2012 10:46 PM Subject: [Audyssey] For Philip re: BGT interfaces vs inheritance. 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.