File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes confused with my design,thanks for you comment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "confused with my design,thanks for you comment" Watch "confused with my design,thanks for you comment" New topic
Author

confused with my design,thanks for you comment

Christopher Washington
Greenhorn

Joined: Jan 20, 2003
Posts: 5
hi,all
I am very confused with my design before upload.
Comments are very welcome and will be much appreciated.
suncertify.db
Data DataInfo FieldInfo DatabaseException //not changed
interface DataAccessInterface extends Remote //for DataAccessLocal and DataAccessRemote. have all the public method of Data class and have criteriaFind(String criteria),book(String flightNumber,int num),String[][] getData()
interface ConnectInterface extends Remote// for ConnectRemote(the Remote Object)
suncertify.server
ConnectRemote extends UnicastRemoteObject implements ConnectInterface //the Remote Object,new DataAccessRemote(dbname).
private LockManager lockManager; //to product a unique LcokManager
DataAccessRemote extends UnicastRemoteObject implements DataAccessInterface //Remote Object too,as clientID,I am confused with it. Can I do it like this?
LockManager // change lock(int) to lock(String flight,ClientID) ,confuse too
FBNServer // Remote server:new ConnectRemote().
suncertify.client
DataAccessFactory //connect factory, return DataAccessLocal or DataAccessRemote
DataAccessLocal implements DataAccessInterface //Local data
FBNClient
FBNClientFrame// dataAccessInterface.book(String flightNumber,int num)
FBNTableModel
FBNComboboxModel
no SecurityManager
and can i copy DataAccessRemote_stub to client.jar?
Thanks for your comment and advice.
Christopher
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

I am very confused with my design before upload.

I don't want to sound mean spirited, but if you are confused with your own design, imagine how confused your assessor will be. This assignment is like marriage, -- if you are not sure about your choice, it will fail. No one can make this choice for you, -- you need to undestand it by heart and soul.
The good news is that you have a ranch full of competent marriage councelors here willing to help. That is, unless you ask "I married a blond, and I am confiused. What should I do?".
Eugene.
Christopher Washington
Greenhorn

Joined: Jan 20, 2003
Posts: 5
^_^,thank you
I have not enough confidence.
can you give me some advice.
thank you
Christopher Washington
Greenhorn

Joined: Jan 20, 2003
Posts: 5
somebody help!?
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
interface DataAccessInterface extends Remote //for DataAccessLocal and DataAccessRemote. have all the public method of Data class and have criteriaFind(String criteria),book(String flightNumber,int num),String[][] getData()
There's a fundamental design problem with that. This mixes low-level, concrete, generic database API ("criteriaFind", "read", "write", etc) with high-level, abstract, application-specific business API ("book"). Never the twain should meet.
On an architectural level, take a look at my boilerplate 3-tier architecture diagram[tm]:
User Interface <==> Business Logic <==> Database
You find this approach in almost any well-conceived modern application. There are three tiers, and two interfaces between them. You are mixing up the two interfaces, which means you are mixing up the Business Logic tier with the Database tier.
In the FBN project, either interface is in principle a good candidate for the RMI interface between the client and the server. However, Sun's requirement that you should have a client-side object that implements all the public Data method effectively forces you to make the RMI interface correspond to the Business Logic <==> Database interface. Anything else would make a muddle of your architecture.
With the above considerations in mind, it should be clear that the book() method implements business logic, and that it therefore cannot live on the server.
DataAccessRemote extends UnicastRemoteObject implements DataAccessInterface //Remote Object too,as clientID,I am confused with it. Can I do it like this?
Yes, fine.
DataAccessLocal implements DataAccessInterface //Local data
What do you need this for? Surely Data implements DataAccessInterface? Junk this class. It serves no purpose.
and can i copy DataAccessRemote_stub to client.jar?

Either that, or put it in a shared.jar and use the Class-Path manifest attribute in client.jar and server.jar to link in shared.jar.
HTH
- Peter
Christopher Washington
Greenhorn

Joined: Jan 20, 2003
Posts: 5
Thank you Peter,
You are Great!
 
wood burning stoves
 
subject: confused with my design,thanks for you comment
 
Similar Threads
How to create unique Client ID
Design Opinion
DataAccess class for remote/local
Design Choice...(Post your opinions)
Design Question?