• Post Reply Bookmark Topic Watch Topic
  • New Topic

Enumerations or instance methods?  RSS feed

 
rscheffer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have coded using both implements Enumerations as well as create instance methods that do the same thing and have yet to figure which way is better. I would guess that implementing Enumeration would be better if you had client code that called for such (As it perhaps should or maybe better some other Collections interface). But what are the costs, if any, on the object creation for Enumeration vs. just having instance methods that would do the same?
Furthermore, since Enumeration is now becoming obsolete because of the Collections interface, which interface will now be the norm for doing such a task? Does this mean we will skip implementing a Collections interface and stick with our own? I hope not.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your name "rscheffer" does not comply with the JavaRanch naming policy. Please choose one that meets the requirements.
Without an accptable name, you will not qualify for JavaRanch free giveaways!, so its worth the try

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the duplicate thread here - http://www.javaranch.com/ubb/Forum15/HTML/000139.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!