473,471 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

From C++ to Java

Hi,

I have asked this question in a C++ newsgroup, but I did not get quite the
answer that I had hoped for. I would like to find out if there are tools
which make large transitions from C++ to Java easier. I am looking at about
one hundred classes with a logical hierarchy and many dependencies.

Will any tool convert syntax semi-automatically? Will any tools simplify the
construction of Java classes? Are there any tools or Web links that refer
to this subject? Maybe some advice? Is this a smart move at all?

I would be very grateful for any input that you are able to give.

Roy

--
Roy Schestowitz
http://schestowitz.com
Jul 17 '05 #1
5 2669
Roy Schestowitz <ne********@schestowitz.com> wrote in
news:ct***********@godfrey.mcc.ac.uk:
Hi,

I have asked this question in a C++ newsgroup, but I did not get quite
the answer that I had hoped for. I would like to find out if there are
tools which make large transitions from C++ to Java easier. I am
looking at about one hundred classes with a logical hierarchy and many
dependencies.

Will any tool convert syntax semi-automatically? Will any tools
simplify the construction of Java classes? Are there any tools or Web
links that refer to this subject? Maybe some advice? Is this a smart
move at all?


Probably not since the class heirarchy and design priniples of java are
very different from c++.

As for it being a smart more, I really cannot say. "the right tool for
the right task" is my motto. Only you can determine whether java is a
better language for your project.
Jul 17 '05 #2
Hi,

I have asked this question in a C++ newsgroup, but I did not get quite
the answer that I had hoped for. I would like to find out if there are
tools which make large transitions from C++ to Java easier. I am
looking at about one hundred classes with a logical hierarchy and many
dependencies.

Will any tool convert syntax semi-automatically? Will any tools
simplify the construction of Java classes? Are there any tools or Web
links that refer to this subject? Maybe some advice? Is this a smart
move at all?


Probably not since the class heirarchy and design priniples of java are
very different from c++.

As for it being a smart more, I really cannot say. "the right tool for
the right task" is my motto. Only you can determine whether java is a
better language for your project.


Java is suitable for all projects, except mission critical projects.
Prove me wrong.

Cheers
Michael
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.851 / Virus Database: 579 - Release Date: 28/01/2005
Jul 17 '05 #3
"Sharp" <Sh***@SharpAddress.com> scribbled on the stall wall:
> Hi,
>
> I have asked this question in a C++ newsgroup, but I did not get quite
> the answer that I had hoped for. I would like to find out if there are
> tools which make large transitions from C++ to Java easier. I am
> looking at about one hundred classes with a logical hierarchy and many
> dependencies.
>
> Will any tool convert syntax semi-automatically? Will any tools
> simplify the construction of Java classes? Are there any tools or Web
> links that refer to this subject? Maybe some advice? Is this a smart
> move at all?


Probably not since the class heirarchy and design priniples of java are
very different from c++.

As for it being a smart more, I really cannot say. "the right tool for
the right task" is my motto. Only you can determine whether java is a
better language for your project.


Java is suitable for all projects, except mission critical projects.
Prove me wrong.


Prove to me that God exists...See where we have our quandry now?
Your argument is simply religious rhetoric in favor of a language that
you like.

Besides, I have yet to see a project that is not "mission critical"
according to management.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #4
""Sharp" <Sh***@SharpAddress.com>" wrote in comp.lang.java:
Hi,

I have asked this question in a C++ newsgroup, but I did not get quite
the answer that I had hoped for. I would like to find out if there are
tools which make large transitions from C++ to Java easier. I am
looking at about one hundred classes with a logical hierarchy and many
dependencies.

Will any tool convert syntax semi-automatically? Will any tools
simplify the construction of Java classes? Are there any tools or Web
links that refer to this subject? Maybe some advice? Is this a smart
move at all?


Probably not since the class heirarchy and design priniples of java are
very different from c++.

As for it being a smart more, I really cannot say. "the right tool for
the right task" is my motto. Only you can determine whether java is a
better language for your project.


Java is suitable for all projects, except mission critical projects.
Prove me wrong.


Please define "Mission critical."

--
Randolf Richardson, pro-active spam fighter - rr@8x.ca
Vancouver, British Columbia, Canada

Sending eMail to other SMTP servers is a privilege.
Jul 17 '05 #5
Roy Schestowitz asked:
I would like to find out if there are tools which make large
transitions from C++ to Java easier. I am looking at about one
hundred classes with a logical hierarchy and many dependencies.

Will any tool convert syntax semi-automatically? Will any tools
simplify the construction of Java classes? Are there any tools or
Web links that refer to this subject? Maybe some advice? Is this a
smart move at all?


We just did a hand-conversion of this very type, we have a C++
application with a class library for about the same size (~100
classes) that we just converted to C# for a client (not exactly Java,
but very close for this purpose).

We did the conversion by hand, because the syntax is close enough.
The syntactic conversion took on the order of a couple of weeks (or
less, perhaps only a couple of days; and a good bit of that was
learning C#). I am not awaare of any tools that will do it for you.
However, there might be something in the DMS toolkit (if you can
afford it) that does exactly that task. One of the reasons that I
doubt there are tools that take one very far is that there are severl
points of "impedence mismatch" between that languages, things which
one can/must express/distinguish in on language than one cannot/does
not express distinguish in the other. One really needs to understand
the relationships between the classes and their member functions to
make the conversion (a tool is not likely to be able to do that).

That said, after the syntactic conversion came the "real work". In
addition to the syntactic issues, there is a real difference in the
way one deals with data in the two languages. In C++ one uses a lot of
"value types" and pointers, these are types where significant
semantics are attached to destruction and copying of data. In
Java-like languages, the implicit reference types and garbage
collection do the work. The class library we had, had one important
set of arrays of pointers that it manipulated, which was very
important semantically and for performance. It took significant work
(and the performance side of that is not completed) to create a
similar structure in C#--the underlying model was different and we
kept getting items shared, when we wanted a copy of the item, where we
could change some members.

This was in a library that was OO, but not template oriented. I would
shudder to think what additional issues might be encountered if one
had that additional level of semantic mismatch. Now, perhaps if one
had a very modern library that was more "functional" in nature
(e.g. boost), the mismatch would actually be lessened.

So, as always, how difficult the job will be and how smart it will be
to do the conversion, depends heavily on what your original C++ coding
style was and how close that is to the Java model. The bulk of our
code converted easily and with little effort. However, the key
performance critical part was not Java-like at all and that was the
major source of work. We spent 90% of the conversion time on this 10%
of the code, and we still aren't completely happy.

Hope this helps,
-Chris

************************************************** ***************************
Chris Clark Internet : co*****@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble...
0
by: Nils Valentin | last post by:
Hi MySQL Fans ;-), Is it possible that the 3.08 series allows to connect to 4.0.14 versions but not to the 4.1 alpha-versions ? I get belows error when tryig to connect from DbVisualizer which...
0
by: global | last post by:
Hi, can anyone help me I'm on Linux with UDB Runtime-Client 8.1.4 and try to connect to a windows udb-server 8.1.4 via Websphere and jdbc , and get this error: 3e1a29e5 WebGroup E...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
2
by: mathersj | last post by:
Hello I was wondering whether anybody knew what this error may be telling me: HTTP Status 500 - -------------------------------------------------------------------------------- type...
8
by: menmysql | last post by:
i am not bale to solve this problem since two weeks i am trying to access records from mysql database using jsp. inside this jsp program i wrote all my JDBC code. it is working very nicely and...
13
by: no1zson | last post by:
I am a beginner here, still in my first Java class, so I hope this question is not so simple as to offend anyone, but I am finishing up my cd inventory program. Adding some GUI buttons to manipulate...
11
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
4
by: lilyumestar | last post by:
I have project I have to do for class. We have to write 4 different .java files. Project2.java HouseGUI.java House.java HouseSorting.java I already finish House.java and I need to work on...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.