This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Using/extending a Frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using/extending a Frame" Watch "Using/extending a Frame" New topic

Using/extending a Frame

Preeti Yarla
Ranch Hand

Joined: Sep 08, 2007
Posts: 69
For GUI apps I am not sure how you decide between using a frame(has-a relationship) and extending a frame(is-a relationship). In real-time projects does a design requirement say something about it or does the programmer need to decide that?

This may be simple but I don't know how to choose!

[ June 12, 2008: Message edited by: Preeti Yarla ]

arulk pillai
Ranch Hand

Joined: May 31, 2007
Posts: 3359
Check this out

Favor composition over inheritance.
[ June 12, 2008: Message edited by: arulk pillai ]

[] | [Java job hunting know how] | [Java resumes]
Preeti Yarla
Ranch Hand

Joined: Sep 08, 2007
Posts: 69
Thanks arulk! The link has good arguments for both composition and inheritance. But I could decide that for all the examples I have been working on so far composition is the right choice.
I agree. Here's the link:
subject: Using/extending a Frame
It's not a secret anymore!