Zhang, Larry (L.) wrote:
I knew my question may not be very related to this list, but let me just
ask anyway:

I have many DB2 stored procedures, for each procedure I correspondingly
have a Java parser to parser the result set. I currently name these
classes the same name as stored procedure. Example, Csm5RRP (this is the
stored procedure name), then my Java class name is Csm5RRPParser.java.

Then 2 days ago, they have to change the names for all the stored
procedure, to makes things meaningful, I have to rename all my java
classes. -- this is really a pain.
Do you guys have an argument on this? Is this a good naming practice? If
not, what will be the naming convention in this situation?

About the only thing people seem to 100% agree upon about naming conventions is that you should probably have one, that you should document it if you do, and that if you have one, STICK TO IT.

As to what that convention is, you'll see a ton of debate. Personally, I think your naming convention is fine.

As for the fact that the sprocs have changed names, I'd change the names of the java classes so they match the new names. Again, if you've got a naming convention, STICK TO IT. Sometimes sticking to it causes more work.

Oh yah, and let your sproc guys know that you're syncing your Class names to their sproc names and that name changes adversely effect you. They should know when they make more work for you. Might not change any behavior on their part, but communication is rarely a bad idea.

As for the name change...

Your IDE should make a Classname-refactor pretty easy. Just be sure to double-check files the IDE might not reach (like Struts XML Action definitions and the Spring context xml, etc.)

And if you're not using an IDE that makes refactoring easy... Go get an IDE that makes refactoring easy! (NetBeans, Eclipse, IntelliJ all have built-in refactoring support that will do the above easily).

And if you have a unit-test suite (you do, right?) running after the refactor should give you great confidence that all is working fine again. That's one of the huge benefits of a test suite, takes a lot of the "hope and pray" out of a refactor.

My $.02.

- Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to