Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MVC in Swing  RSS feed

 
Cesar Tg.
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

I'd like to know how to implement a MVC architecture in a Java
Swing application???

something similar to struts or java server faces where there is a controller that controls pages flaw, is it posible???


Thanks
Csar.
 
sammaiah kyatham
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We can implement MVC by writing our own classes.
1. Write one BusinessDeligate Class, which contains mapping of ur server side methods and Client side methods.
-use servicelocator design pattern for Lookup EJBs
-this acts as Controller

2. Write one abstract Command class, for each method in delegate write specific Command classe which extends ur abstract Command class.

3. If u want to call one particular business method, just instantiate corresponding command class and call that particular method. Usually we'll create Command classes in ur Swing ....


I think this clears to proceed with MVC in Swing clients.
If any queries feel free to ask me.


Thanks,
sam
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!