We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Designing a class for inheritance

gudii9
gudii9 asked
on
Medium Priority
297 Views
Last Modified: 2012-05-11
>>>Designing a class for inheritance places substantial limitations on the class.

I have not clearly understood this statement, concept.

Please advise. Any ideas, sugestions, sample code, links, resources highly appreciated. thanks in advan
Comment
Watch Question

Awarded 2011
Awarded 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
>>>Designing a class for inheritance places substantial limitations

do they mean

>>>Designing a class for subclassing (by extends not implements by inheritance) places substantial limitations

>>>However if the class IS designed to support inheritance, there's a much tighter relationship between it and any classes derived from it.  We like to say it's much more "tightly coupled".

Inheritance supposed to avoid tighter relationship/coupling right than subclassing. please advise
Awarded 2011
Awarded 2011

Commented:
No, designing for inheritance and designing for subclassing is the same thing
Thoese are just different terms but mean the same - if you are writing the class, which you believe
at some point other people will want to write class which will extend your class (inherit from your class, subclass your class-
all the same terms) , then youn want
to follow these recommendations/guidelines.
It is all the same - "the class which supports inheritance" still the same meaning - you believe, that someone will want
to write another class which extends your class, then follow the above discussed points
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.