Forrest Xu

Greenhorn
+ Follow
since Jan 30, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Forrest Xu

I belive you use Abstract Factory
I believe I used some Design patterns in my project. But I am not very sure about it. please help me to check if the following is correct idea:
1) For local database, I use Data class which implements IData that has all database method. for remore databse, the database class I used implements IData. So local/remote database is an object of IData. Based on local mode and remote mode, I get a IData object. Does it mean
I use abstract factory pattern?
2) For remote database, I wrap the Data class.
Does it mean I use adapter pattern?
3) To create an unique database instance, I think
I use singleton pattern?
4) MVC pattern has been used in JTable GUI?
5) please tell me any other Design patterns may use?
Thank you for your help!
Hi Mark,
I changed my name now.
I am in Canada.
I almost have no time to develop the assignment.
I need to work to support my family. The work for company and for home are all very busy. So I only can give a very little time to the assignment.
Now the application seems work, but need to write the documentation.
Thank you for your web site.
Forrest
Thanks for your replay!
my Data class
1) implements an interface IData.
2) no any subclass of Data class.
For 2) it is obviously modifying.
how about 1) is it Extending?
thanks
In design choices documentation, we need
write something for modifying vs. Extending the Data clas. but what is modifying? and what is
Extending?
My explain for modifying is that just changes the code and does not change signiture of the class method.
Extending means change signiture of the class, Add method or
subclass from interface like IData?
please help me!
thanks
Hi all,
I have some problem about writing comments in source code. Please see:
1. version. the assignment version is @version 1.1. how about updated class version? how about new class' version? Do I need tell Sun what vesion the new version is based on? How to do it.
2. I does not changes lock method in Data class.
how to write the comments for it. can I write something like following words?
/**
* This method in Data object will not be called in this assignment. Keeps
* it unchanged.
*
* @param recno The record number to lock.
* @exception IOException If the record position is invalid.
*/
3. deprecated method comments in
private synchronized String[] readRecord() throws IOException.
can I write something like following words?

/**
* Reads a record from the current cursor position of the underlying random
* access file. version 1.1 uses
* rv[i] = new String(buffer, 0, offset, description[i].getLength();
* It is deprecated method that uses the platform's default encoding. Uses
* rv[i] = new String(buffer, offset, description[i].getLength());
* to construct a new String by converting the specified subarray of buffer
* using the platform's default character encoding.
*
* @return The array of strings that make up a database record.
* @exception IOException Generated if the RandomAccessFile cannot read from
* the database file.
*/
4. Does the design choice need to be added in the comments? Where is the best place, Class comments or methods comments?
Please help me!
Thanks in advance.
Java2de
Hi,
How about for lock(int record) when record = -2 or
record > record count. In this case, do we need
to throw some exception like DatabaseException?
DataAccessLocal - Implements DataInterface. This is used on the client side for connecting to the Data class. The Data class is wrapped within. The constructor takes a dbName as its argument.
Why do we need DataAccessLocal? I think we can use
Data class to replace it. Is it possible?
Thx
XIU
Thanks Mark,
--------------------------------------------------------------------------------
Can the methods in DataInterface or DataAccess talked above throw RemoteException, DatabaseException?
--------------------------------------------------------------------------------
Yes, or you can just have them throw Exception, and in the implementation of the interface throw a more specific Exception.

Which one is better? and why?
Thanks Mark!
XIU
Can the methods in DataInterface or DataAccess talked above throw RemoteException, DatabaseException?
Does the method in IData throw RemoteException, DatabaseException?
Thank YOU!
Andre and Mark.
http://www.patterndepot.com/put/8/DesignJava.PDF
is a great one.
Thank you very much!
Java2de
Please see instruction:
to connect with your server, you should creae a cliebt program. this implemtntation should include a class that implements the same public methods as the suncertify.db.Data class. ......

your class is like below.
RemoteFBNSystem implements RemoteFBNIntf extends UnicastRemoteObject : implements the business logic methods to be invoked remotely.
where is the same public methods as the suncertify.db.Data class?
javad2e
Hi,
I think your design not follow instruction.
Meanwhile, Normally Server needs more generic methods. Service method should not be included in server. for example, if some day service has been changed. in your design both server and client also needs to be changed. So I think you may change your design.
but antwhy your design help me a lot.
thanks,
java2de.