This week's book giveaways are in the JBoss and Spring forums.
We're giving away four copies each of JBoss AS 5 Development and Spring Dynamic Modules in Action and have the authors on-line!
See this thread and this one for details.
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of JBoss AS 5 Development this week in the JBoss forum
or Spring Dynamic Modules in Action in the Spring forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
Author

Where exactly should we use protected classes?

Kunaal A Trehan
Ranch Hand

Joined: Feb 04, 2004
Messages: 63

Can some one explain me when exactly we shd go for the protected classes?
A use case will help me alot

Rgds
Kunal
Ernest Friedman-Hill
author
Sheriff

Joined: Jul 08, 2003
Messages: 20990

Inner classes can be "protected" but top-level classes can't. Are you talking about protected inner classes, or are you simply talking about non-public classes?

In any case, this is the sort of question entertained in our OO, Patterns, UML, and Refactoring" forum. I'll move this post there for you.

[Jess in Action][My Art][AskingGoodQuestions]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Messages: 14088

I don't think I've ever used a protected class of any kind. My guess is that it exists more for reasons of language consistency and less for reasons of actual *need*.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » OO, Patterns, UML and Refactoring
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench