aspose file tools*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using/extending a Frame" Watch "Using/extending a Frame" New topic
Author

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!

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

SCJP
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3275
Check this out http://www.javalobby.org/forums/thread.jspa?forumID=61&threadID=16487


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

500+ Java Interview Questions and Answers | 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: http://aspose.com/file-tools
 
subject: Using/extending a Frame