[geos-devel] A word about Javisms

Mateusz Łoskot mateusz at loskot.net
Thu Mar 23 22:03:09 EST 2006


Hi,

This post is just a digression about Javisms.
As a C++ purist, I was always affraid of Javisms.
GEOS is a kind of direct port of JTS - Java software - so there
is potential Javisms hazard around.

I'm just reading about design of TUT Framework the its author - Vladimir
Dyuzhev - gives small overview of Javisms in relation of existing ports
of JUnit.

I hope you don't mind if I suggest to take a look at this small
paragraph. That may provoke to reconsidering relation between GEOS and JTS.

http://tut-framework.sourceforge.net/design/

"Javisms

Most implementors of C++ test frameworks know about JUnit and inspired
by this exciting tool. But, carelessly copying a Java implementation to
C++, we can get strange and ugly design.

Rather obvious example: JUnit has methods for setting up a test (setUp)
and for cleaning after it (tearDown). I know at least two C++ frameworks
that have these methods with the same semantics and names. But in C++
the job these methods do is the responsibility of constructor and
destructor! In Java we don't have guaranteed destruction, so JUnit
authors had to invent their own replacement for it - tearDown(); and it
was natural then to introduce constructing counterpart - setUp(). Doing
the same in C++ is absolutely redundant

C++ has its own way of working, and whenever possible, I am going to
stay at the C++ roads, and will not repeat Java implementation just
because it is really good for Java."


Things I'd like to discuss and learn are (in groups):

Should GEOS be direct port - a mirror - of JTS?
If it should, how to make it a mirror but in C++ manner?

Are there any places in GEOS representing Javisms? How to redesing it?
What kind of problems existings Javisms in GEOS causes?
Does it decrease performance in any way?
What is "the right way" to solve and redesign particular
Javisms in GEOS?

What does GEOS compatibility with JTS mean?
Does possible redesign to C++ style will make GEOS incompatible
with JTS in any way?
What about idea to make GEOS compatible with JTS on the level of
interface but not implementation?

Finally, GEOS is a C++ application but how to make C++ API stable?

I'd love to hear your opinion about those issues.

Best regards
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list