-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

bertrand greslier wrote:
> Hi Jan,
> 
> Add automaticaly a try catch or automaticly recode a similar multiple
> inheritance seems not be difficult.
> Example class A { int x; }; class B{ int y; }; class C : public A, B { int
> z; public:  void test(){z = x + y:} ; };
> =>(java translation) => public class C : extends A {  int z; B b; public
> void test(){ z = x + b.y; } };

This is completely wrong - you have replaced inheritance with aggregation which
is a completely different beast. What if I want to derive a class D from your
class C? In C++ it will inherit properties of A and B. In your case it will not.
 The proper way would be to convert one of these to an interface, but this is
probably not doable automatically. Such class hierarchies are common in OSG (or
any C++ program using multiple inheritance).

> (What is that IMHO please?? I am not very fluent in english)

IMHO = In My Humble Opinion

> C code is not object oriented code. I think you don't compare apples with
> apples.

Well, in fact porting C to Java is simpler than porting C++ (much smaller
feature set) and this was done manually, without trying to write an automated
translator first. This was a much smaller task than what you propose, in my
opinion, and it went horribly wrong.

> And I am a java expert (I believe it ;-)).

However you are for sure no C++ expert as you can clearly see from your botched
example of multiple inheritance. That the things are called the same in both
languages doesn't mean that you can assume that they work the same. They do not.

> Yes a slowdown. The result is also a little slowdown. You are right. But it
> is not
> my goal, my goal is to have a independant platform code as the java is.

Which you will not have due to the required interface to OpenGL and other things
(e.g. high resolution timers which are OS dependent).

> And my fist goal was to extend the OSG community to the java community.
> And I believe that if you have a good frame rate it is not only because C++
> is faster than java.
> It is your graphic card witch work for the C++ not the inverse.

True, however I have to yet see a graphic card which has a Java driver. You have
to use the low level code somewhere (OpenGL, Java3D, whichever 3D API you
choose), that essentially defeats the portability requirement - you will not get
better portability than with the current C++ code.

And providing Java support - well, there are Java bindings already. Why do you
think that nobody made "pure Java OpenGL"?

> I know that.  But for example  XML Xerces  has  C++ and Java
> implementation.

Except that Xerces doesn't talk to hardware at any point and is essentially a
tool to process streams of text, nothing more. Not exactly apples-to-apples
comparison.

> I could be interessant for OSG to become also a standard API in java.

That's true. However, this is not the way to do so, IMHO.

Jan

- --

Jan Ciger
GPG public key: http://www.keyserver.net/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFFfeMbn11XseNj94gRAsJUAKCWv5gK/ZGDJLPZQCkbiN/vzKmH1QCg26FA
f+OOaq19dN6xGMXxyr6nRLc=
=FBkX
-----END PGP SIGNATURE-----
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to