db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Coding Style in Torque tasks
Date Fri, 25 Jul 2003 15:19:03 GMT
Hi,

personally I think that null pointer exceptions as error messages are
a sign of bad code style. Stuff like this

http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Attic/Database.java.diff?r1=1.15&r2=1.16&search=None&hideattic=0

[...]
+                    if ( local == null )
+                    {
[...]
+                    }
+                    //check for foreign pk's
+                    if (local.isPrimaryKey())
[...]


+                    if ( foreign == null )
+                    {
+                        System.out.println("ERROR!! Attempt to set foreign"
+                                           + " key to nonexistent column, " +
+                                           foreign.getName() + ", in table, "
+                                           + foreignTable.getName() + "!" );
+                    }
+                    foreign.addReferrer(currFK);

isn't only offensive to my eyes but makes me wanna puke.

Then seeing patches like the if (con == null) plaster checked in
without any thought makes me wonder in which direction we're heading
with Torque or any other Apache project.

Style and taste is IMHO not optional.

	Regards
		Henning



-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

"You are being far too rational for this discussion."  
       --- Scott Robert Ladd in <3F1874B0.6030507@coyotegulch.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message