newbie questions 1,2



Hello!

First of all, thank you for your hard and excellent work on Bonobo and
bonobo.

Now, I'm starting to read the samples code on bonobo, and I have some
questions. I send them to this list in the hope that someone could help
me. Thank you very much in advance for your attention!


All references to source code are in the form of URLs to LXR at
cvs.gnome.org. Tell me if you prefer it other way.



*** Question 1.

http://cvs.gnome.org/lxr/source/bonobo/samples/bonobo-class/echo.c#61

The comment say:

 59 /*
 60  * If you want users to derive classes from your implementation
 61  * you need to support this method.
 62  */
 63 POA_Demo_Echo__epv *
 64 echo_get_epv (void)

But I think this is incorrect. Since echo_get_epv is called in the class
constructor
(http://cvs.gnome.org/lxr/source/bonobo/samples/bonobo-class/echo.c#82 ),
this method need to be implemented anyway, even without derived classes.

So, the question is: should it say "If you want users to derive classes
from your implementation you need to export this method in the public
header"?



*** Question 2

http://cvs.gnome.org/lxr/source/bonobo/samples/bonobo-class/echo.c#161

The lines read:

159         CORBA_exception_init (&ev);
160         POA_Demo_Echo__init ((PortableServer_Servant) servant, &ev);
161         ORBIT_OBJECT_KEY(servant->_private)->object = NULL;

a) Why is it necessary to make null a private field?
b) It breaks encapsulation or something like that, doesn't it? (because
it's modifying a "_private" field)
c) I think this does the bonbobo-class echo sample highly dependent on
ORBit. Why it is correct to do it?

I know I don't need to manually create the servant when using bonobo
anyway, because the function bonobo_embeddable_corba_object_create (if I
am creating an Embeddable) creates for me. But, what about if I want to
create my own interface, such as it is done in this sample? I mean, the
next question is:

d) Will I, as bonobo user and developer of my own application, ever need
to call ORBIT_OBJECT_KEY?



Thank you for any help!



	Saludos!
	Greetings!

-- 
Name:  Arturo Tena
email: arturo directmail org
ICQ:   63292893





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]