Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SwingWorker & packaging

 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1).Should SwingWorker class be used.
Since it is not a part og swing. Is it ok if
I put it in the client folder and use it.
2). I am doing FBN and I have a FlightDAO which implements the remote
interface. I have a StandAloneDAO which extends FlightDAO.
I have done this to resuse code.
I have made this a part of the common/dao package.
But actually FlightDAO is required only on the server.Is it
okay to have it this way.
[ July 31, 2003: Message edited by: Akshay Sharma ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11888
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Akshay
Should SwingWorker class be used.

I assume you talking about SwingWorker as in the SwingWorker example code used in the Swing tutorial.
You are not supposed to submit any code that is not your own work. Since you are supposed to subclass SwingWorker to do what you want anyway, I think you would be safer to just build your own class - it is not difficult for such an easy class.
StandAloneDAO which extends FlightDAO....

I think this means that even in local mode, your client will be calling the methods of the class that extends Remote (even though it is not using networking). Is this right?
Regards, Andrew
 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew ,
I was talking abt this SwingWorker on;y.
Yaa even in Local mode internally StandAlone wil call methods of FlightDAO which extends Remore.
This is just for code reusability.I can ver well replicate the same code
in the StandAlone class.
******************
One more concern.
The assignment says that
"Writing Data Client
To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration. "
In the data class u have read / write etc etc why should these be implemented again. I am confused.
******************
Rgds
[ July 31, 2003: Message edited by: Akshay Sharma ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11888
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Akshay
Instructions: To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration. "
Akshay: In the data class u have read / write etc etc why should these be implemented again. I am confused.

I think you are taking a bad interpretation of "implements".
What is needed to meet this requirement (in my opinion) is a class that has methods with the same name and equivalant functionality (via networking) as the public methods of Data class.
That is, inside my client application, I should be able to call a method named update() which has almost the same signature as the update method in Data class, that will perform the update by sending the update request through the network until it eventually reaches the Data class which will do the real update.
Does that make sense?
Regards, Andrew
 
Akshay Sharma
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew just to reconfirm.
Currently I am having a FlightDAO which extends Remote
and a StandAlone DAO which extends FlightDAO.
Now if I modify StandAloneDAO not to extend FlightDAO and
also I put all methods in Data in StandAlone DAO then it should be fine
right.
I will move FlightDAO to server and StandAlone to client packages.
Curentl; they are in common/dao package
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11888
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Akshay
Yes, this looks like a good plan.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic