Cell Phone Software Forum
| View previous topic :: View next topic |
| Author |
Message |
Sashi Guest
|
Posted: Fri Mar 30, 2007 7:24 pm Post subject: Porting an application across languages |
|
|
Hello,
I've been assigned a task of porting an application from Perl to Java.
The reasons I'm not sure of. We can safely assume that the original
developer has left and that there is little documentation (the usual
state of affairs).
I'd prefer to first understand what the application does and try to
write my own requirements and them implement in Java. I'm not a big
fan of reading someone else's code and trying to figure out what's
going on.
Add to that the fact that I'm a perl newbie. So I'd prefer to do the
requirements, design and code myself.
I haven't had to do such a porting before and this is my first time.
Hence the problem boils down to understanding in as much detail as
possible how the given (perl) application functions.
Any inputs/pointers from those who have some experience in porting
between languages? Perls of wisdom? ;-)
Thanks a lot!
Sashi |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
Paul E. Black Guest
|
Posted: Fri Mar 30, 2007 9:04 pm Post subject: Re: Porting an application across languages |
|
|
On Friday 30 March 2007 10:24, Sashi wrote:
| Quote: |
I've been assigned a task of porting an application from Perl to Java.
The reasons I'm not sure of. We can safely assume that the original
developer has left and that there is little documentation (the usual
state of affairs).
I'd prefer to first understand what the application does and try to
write my own requirements and them implement in Java. I'm not a big
fan of reading someone else's code and trying to figure out what's
going on.
|
It is entirely reasonable to understand the application and write your
own requirements. Especially if you can talk to people that use it.
I strongly suggest you read the code before beginning any serious
implementation. There are likely to be subtle behaviors or
requirements that simply playing with it are unlikely to uncover.
Imagine reverse engineering day/date behavior just from exploring an
app without knowing the subtle leap year rule (leap year if year is
divisible by 4 UNLESS it is divisible by 100 UNLESS it is divisible by
400).
Even if you don't understand every line and operation or how it does
what it does, it should be straight forward to trace through things to
spot odd modules or funny looking code and note things to investigate
further.
-paul-
--
Paul E. Black (p.black@acm.org) |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
H. S. Lahman Guest
|
Posted: Sat Mar 31, 2007 12:48 am Post subject: Re: Porting an application across languages |
|
|
Responding to Sashi...
| Quote: |
Hello,
I've been assigned a task of porting an application from Perl to Java.
The reasons I'm not sure of. We can safely assume that the original
developer has left and that there is little documentation (the usual
state of affairs).
|
You might want to find out exactly why the port is needed. That could
affect your strategy.
Suppose the reason is simply that no one understands perl well enough to
maintain it while lots of people understand Java in the shop. Then a
literal port is not a high priority; what one really wants is a
maintainable Java application that resolves the requirements. Then you
extract the requirements somehow and write a new Java application.
OTOH, suppose the reason is that some other application needs to
interoperate with it but dealing with the perl run-time environment is
too much of a hassle. Then the goal is simply to get the functionality
into Java by brute force via literal porting. Then you learn perl and do
a line-by-line port.
| Quote: |
I'd prefer to first understand what the application does and try to
write my own requirements and them implement in Java. I'm not a big
fan of reading someone else's code and trying to figure out what's
going on.
Add to that the fact that I'm a perl newbie. So I'd prefer to do the
requirements, design and code myself.
|
Then you are in trouble either way. B-) Literal porting will be
difficult because perl and Java have different views about things like
references and indirection. If you don't know the language, it will be
tricky to extract the requirements from the code. AFAIK there are no
reverse engineering tools for perl so you can't get back to a shared
design view.
Your best bet is to find some user of the application who knows what it
is supposed to do and get your requirements there.
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@pathfindermda.com
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@pathfindermda.com for your copy.
Pathfinder is hiring:
http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
JXStern Guest
|
Posted: Sat Mar 31, 2007 4:28 am Post subject: Re: Porting an application across languages |
|
|
On 30 Mar 2007 08:24:16 -0700, "Sashi" <smalladi@gmail.com> wrote:
| Quote: |
Any inputs/pointers from those who have some experience in porting
between languages? Perls of wisdom? ;-)
|
Here's one: there is no such thing as a 100% pure porting project.
Someone is going to dump a high priority wishlist on you, probably
when you least expect it. Count on it being somewhere between 30% and
99% of the entire project, unannounced. Beware!!!
J. |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
Phlip Guest
|
Posted: Sat Mar 31, 2007 8:48 am Post subject: Re: Porting an application across languages |
|
|
Sashi wrote:
| Quote: |
I've been assigned a task of porting an application from Perl to Java.
|
Why?
| Quote: |
The reasons I'm not sure of.
|
Fix that first. The worst possible way to start a project is without a
non-technical goal. The technical goal, the Replace Language Refactor, must
serve the needs of the business goal.
| Quote: |
We can safely assume that the original
developer has left and that there is little documentation (the usual
state of affairs).
|
Are there any unit tests?
| Quote: |
I'd prefer to first understand what the application does and try to
write my own requirements and them implement in Java. I'm not a big
fan of reading someone else's code and trying to figure out what's
going on.
|
Write unit tests in Perl to test what the Perl is doing.
| Quote: |
Add to that the fact that I'm a perl newbie. So I'd prefer to do the
requirements, design and code myself.
|
If you cannot read Perl, how will you extract the requirements.
Who is the customer for the new Java version? Can you ask them what one
single feature they need most? Can you write that feature in Java, and
attach it to the Perl program?
(Write the Java feature with unit tests, too. You will find a huge, thriving
community behind JUnit there.)
| Quote: |
I haven't had to do such a porting before and this is my first time.
Hence the problem boils down to understanding in as much detail as
possible how the given (perl) application functions.
|
After you finish that feature, deploy it and put it into use. Then ask
what's the next feature. Keep going until the features the client actually
_needs_ are implemented in Java.
Use unit tests to extract business rules from the Perl, to test what it is
doing in various situations. Then match these with equivalest tests in Java.
And question the choice of Java. There are much _much_ more productive
languages out there, including ones that only require 10% of the source code
lines of a Java program.
(This isn't a Web project, is it?)
--
Phlip
http://flea.sourceforge.net/PiglegToo_1.html |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
Guest
|
Posted: Sun Apr 01, 2007 9:21 am Post subject: Re: Porting an application across languages |
|
|
Sashi wrote:
| Quote: |
Hello,
I've been assigned a task of porting an application from Perl to Java.
The reasons I'm not sure of. We can safely assume that the original
developer has left and that there is little documentation (the usual
state of affairs).
Well, this is probably your starting point: understand _why_ you've to |
do this work.
| Quote: |
I'd prefer to first understand what the application does and try to
write my own requirements and them implement in Java. I'm not a big
fan of reading someone else's code and trying to figure out what's
going on.
This could be "not so easy". The success of this port, in my opinion, |
depend on:
1. how the original Perl program has been coded. If the code was a
little "obfuscated"
everyone (including the original author) could have some problems
reading it;
2. the program complexity
3. your Perl knowledge.
| Quote: |
Add to that the fact that I'm a perl newbie. So I'd prefer to do the
requirements, design and code myself.
mmm.... so the Perl code is not the right starting point. I've 15 |
years Perl experience, believe me, forget the Perl code and start from
scratch with the User Requirements.
Good Luck, mf |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
Sashi Guest
|
Posted: Mon Apr 02, 2007 10:13 pm Post subject: Re: Porting an application across languages |
|
|
All, thanks for your inputs. I wasn't looking for anything specific,
but general tips and comments and I think I do have enough to be able
to define a direction and start working on it.
Regards,
Sashi |
|
| Back to top |
|
 |
| |
Ads |
Advertising
Sponsor
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|

212 Attacks blocked
Powered by phpBB © 2001, 2005 phpBB Group
|