This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, the term "peer" or "peer class" comes into usage especially when talking of awt vs swing. the terminology would say that swing does not use the peer classes and hence it is better. peer classes IMO would refer to the operating system dependent classes. hope that helps
The peer classes are the classes that hook into the native API set in order to draw AWT objects.
Joined: May 12, 2000
Thankyou Rahul and Tom..I get it now! Now if the awt has such operating system dependent classes with lot of native code attached(heavy weight)then we cannot claim that java is fully portable. Suppose we use some heavy weight component then it is not possible to guarantee the same performance on different platforms ? 2) Does swing have no native code attached with it or there is less native code compared to AWT ? Moreover how does swing obtain the same functionality without using native code. what is the IN THING ! that makes swing light weight ? -cheers vijay
Vijay, You should check out the Swing trail in the Java Tutorial. The tutorial is available on the Sun's website. Read first few sections of the Swing trail, especially the one named How Are Swing Components Different from AWT Components? which answers most of your questions. If you still have doubts after reading the tutorial, then perhaps you can come back here and we can discuss. Happy reading.. Ajith
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Joined: May 06, 2000
You are correct in stating that the peer classes will be operating system dependent. I'm not sure that you can make any meaningful statements about performance on one platform based on performance on another platform (whether you are using lightweight or heavyweight components). There are so many variables between platforms that peer classes are probably the least of the issues. Although Swing uses mostly lightweight components there are some heavyweight componenents included (JFrame, for example). [This message has been edited by Tom P (edited May 18, 2000).]