Re: New to GObject, few questions
- From: "Ricardo Malafaia" <rmalafaia gmail com>
- To: "Tomasz Jankowski" <tomcioj gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: New to GObject, few questions
- Date: Fri, 21 Jul 2006 21:05:43 -0300
On 7/21/06, Tomasz Jankowski <tomcioj gmail com> wrote:
I. What the Interfaces are?
of course you know what Interfaces are. You've probably been dealing
with Application Programming Interfaces and C headers for a long time.
They represent the public functionality and data type declarations
presented by an object translation unit -- the Interface to the
module.
In the specific case of object-oriented programming, Interfaces are
simply abstract classes with just method declarations, no
implementation. They can be implemented by various classes of
objects, so as long as a class implements the methods presented by a
given Interface, we say it implements the Interface. It's a kind of
"virtual inheritence".
just to illustrate how the concept of an interface is simple:
/*
* isorteable.h
*/
void sort( void *ls, int (*cmp)(void *a, void *b) );
you can then have a big variety of .c files complying with this
interface, but implementing it with diverse sorting methods (merge
sort, quick sort etc)...
nothing new, really...
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]