This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Design patterns used in Swing and RMI API  RSS feed

 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm just curious is it true that the Swing API uses MVC pattern internally? I read books and articles that MVC this that in Swing blablabla. Similarly, for RMI, is it using the (Remote) Proxy pattern internally by saying "accessing remote objects as if they are local"?

If this is true, so if we use RMI, does it mean we automatically using Proxy pattern? Same for Swing using MVC pattern?
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

K. Tsang wrote:Hi all, I'm just curious is it true that the Swing API uses MVC pattern internally? I read books and articles that MVC this that in Swing blablabla. Similarly, for RMI, is it using the (Remote) Proxy pattern internally by saying "accessing remote objects as if they are local"?

If this is true, so if we use RMI, does it mean we automatically using Proxy pattern? Same for Swing using MVC pattern?



The whole point of MVC is to separate the Model (M), the View (V) and the Controller (C). Because SWING has listener on which you register to listen for actions performed on your View component, it is very MVC.. But, one can easily organize it up incorrectly and deviate from MVC.

The main point of MVC is to dissociate your model from your View. Your model should not know "how" they are displayed. Your model should not directly modify properties in your view. Instead, your view should "observe" the model, be notify of any change and modify itself accordingly.

I don't know if RMI does "exactly" follow the Proxy pattern, I would guess so.. Beside having to handle the extra exception (RemoteException), you do "pretty much" handle local and remote object the same way. I remember being asked this question back in University and I do believe the professor was giving the points for both answers depending on your explanation.

Best of luck
Alex
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!