File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Typesafe constants/enums, Defensive Copying and Immutable Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Typesafe constants/enums, Defensive Copying and Immutable Objects" Watch "Typesafe constants/enums, Defensive Copying and Immutable Objects" New topic
Author

Typesafe constants/enums, Defensive Copying and Immutable Objects

Rodney Woodruff
Ranch Hand

Joined: Dec 04, 2001
Posts: 80
Hello,
I was reading an article at http://www.theserverside.com/home/thread.jsp?thread_id=18040&article_count=37 and figured I would come here to seek answers for this question.
I did search the forum before posting this question but did not find descriptive answers to my questions.
I would like to know if anyone can define the following terms for me as I realize that I don't know the answers as well as I should.
1. Typesafe constants/enumerations (I know what a constant and an enumeration are but I don't know how to make them typesafe or what that means.
2. Defensive Copying
3. Immutable Objects (I have more of an idea about this one but could use some enlightening.)
Any and all help is appreciated


Hope This Helps
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Hi Rodney,
1. Typesafe constants/enumerations (I know what a constant and an enumeration are but I don't know how to make them typesafe or what that means.
I think this is relevant:
http://www.javaworld.com/javaworld/javatips/jw-javatip133.html
2. Defensive Copying
I think this is relevant:
http://www.javareport.com/java/articleold.asp?id=223&mon=1&yr=2000
3. Immutable Objects (I have more of an idea about this one but could use some enlightening.)
I think this is relevant:
http://www.javaworld.com/javaworld/javaqa/2002-12/01-qa-1206-immutable.html
Hope this helps you.
Good Luck,
Avi.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Sorry Rodney,
Forgot this article:
http://www-106.ibm.com/developerworks/java/library/j-jtp02183.html?dwzone=java
(In relation to your third question)
[It's awfully hard to remember where I read these articles from, sometimes!]
Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Typesafe constants/enums, Defensive Copying and Immutable Objects