This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Poor Naming Conventions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Poor Naming Conventions" Watch "Poor Naming Conventions" New topic
Author

Poor Naming Conventions

See Furst
Greenhorn

Joined: Aug 04, 2010
Posts: 29
Ok.. So I got two classes...and they got the same (ok similar) name.

com.thing.mine.package.Item
com.otherthing.mine.package.Item

I need both. Do I really have to explicitly call both?




Is there like a typedef call like in C++ that can help with this?

like:


Doin' Java to be one of the cool kids.
I usually use Perl;
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

You can import one; that already decreases your problem by half.

You cannot typedef a class, but perhaps it's possible to subclass it. It's not really good design to create a class just to rename another though.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
See Furst
Greenhorn

Joined: Aug 04, 2010
Posts: 29
Rob Spoor wrote:You can import one; that already decreases your problem by half.



And how would I import the other? I guess subclass it.. or abstract it?

Of course the obvious answer is use better names but.. unfortunately .. I'm stuck..

I'm taking the subclass route, now that you mention it. It's.. sloppy.. I know.. but... Java could use a typedef kind of keyword. It screams for it. Especially with all these frameworks using common name like "Node", "Item", "Session" jcr is completely built like that.. and that's a Java spec...

Didn't look around too much did they..

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Poor Naming Conventions
 
Similar Threads
class variable shadowing
java - xslt creating csv file
Hashtables and Maps
Triggering event
Mediatortype javaprog requiring solution