Jashua Ni

Greenhorn
+ Follow
since Jul 31, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jashua Ni

Hi, All:

I think I need to change my design after I read the article Marlene recommended. And acturally some of the rules from EJB guide lines that make call using Coarse grained object instead, if it networked call, like EJB methods. Push the atomic business function and make the design as Marlene specified 4 type is more appropriate way to do that.

Thanks a lot, Mike and Marlene.

Jashua Ni
Marlene:

Thanks and excellent thoughts about the RMI implemetation. definitely your thrid approach sounds great to me. And thanks for nice drawing too, which makes thing easier to understand and atrractive.

And I could consider the wrapper on the client side as the return connection from connectioManager, which either instantiates directly or get from RMI lookup.

Also in jdk 1.4, I don't have to do the exception chaining by myself. So hidding the RemoteException should be OK.

thanks a lot.

Jashua Ni
Mike:

Like I said before, you are pushing the business function back to server. I don't see that for client server, server should not know about business rules at all.

Server usually always be database server. database server should know about business logic, some logic can be embeded inside the store procedure. But for this case, it it the right way to do that?

I thought it will be better to filter out from client side some how for the data return back by the database.

Does anybody have advice for this implementation?

Jashua Ni
Thanks,

The problem comes in, that it is a client server approach. Let's say everything you do will be on the client side. the backend database already being defined by Sun. That can be considered as database interface. You can make connection through local (no remoteException) or through server(has RemoteException). If you push you DBClient interface to the backend, as you said. then it defeats the client server design. It is not a thin client, every business rules should be encapsulated on the client side?

Am I right? Or you have different points?
Anton:

Thank you for your reply. So in another words, your DB Adaper implements DBClient interface, which has an instance of Data class, and delagate the call back to data class.

On the client side, only deal with DBclient interface, could be remote or local. So the DBAccess interface has been wrappped up to another interface, DBClient. No DBAcess interface directly exposed to the client.
Am I right?

OK, to me this is the only better approach I can think of. Thanks.

Jashua Ni
Since DBAccess interface doesn't throws RmoteException, which is required by RMI interface, so do I have to create a wrap up interface for that?

Then the local mode and remote mode will need to be handled differently?

That's what I implemented right now, is there a better way to do it?

Thanks,

Jashua Ni
Mike:

Yeah, after you reiterate. I think it's clear. Thanks a lot.

Jashua Ni
Mike:

Thanks a lot.

but for this statement:

and it must also accept an indication that a local database is to be used

I agree with you. The problem is the above statement, does it make sense to create a dialog for user to choose local or network, the word "ALSO" really bothers me. I can see no place will need for user to choose, when the application starts, it already predefine whether it's local or networked already based on the mode server/alone/[].

I try to make everything clear before I submit. Really appreciate if you or other people can give some advice, thanks
Or is the let user select the database location really means select LOCAL or NETWORKED connection?
For my assignment, there is request that allow user to specify the location of the database
means the db file in the file system?

and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely

There are three mode: server/alone/gui_client only

for server mode, let user specify db file is pretty enough, it doesn't mkae sense for local or network indication

for gui_client only, it doesn't make sense for user to choose network or local, 'cause it has to be networked, only GUI and network client will be started as doc states.

So the only place to let user specify local or network is in standalone mode, isn't that local already, or I have to let user choose local and network, then invoke properly, using localhost to loop back if user select network, very strange to me.

Any body has other intepretations?
To my understanding(for my assignment), there is 48 hour limitation. The room has to be booked within 48 hours. It looks that this is not a condition that will make the book fail besides customer id?

Does anybody any suggestions for this?
Julian:

Thank you so much. OK, what I found out is, I copy the file to another machine, and some how got changed. I was doing alomost same as you did, except mode to be "rw", no it's OK. Thank again for your so detail explanation. I appreicated.

Jashua Ni
Thanks a lot, Julian:

I did use RandomAccessFile to read, if I used the method readShort(), an exception will be thrown, says end of file, I also tried to used DataInputStream to read, got same thing, after I read from there through bytes, I can see the 4 byte of '\u0000'. If I open the file in text editor, I could only see wired like square box in the beginning.

Can you see your db file clearly in a text editor?

Thanks a lot and please help,

Jashua Ni
I thought I could replicate this file(which I did during the tesign), the instruction says only the original file is to be used. But there is no magic number, length of recod in bytes, and number of fields in a record. If I read them in through bytes, then convert them using BigInteger, I got 0 for all of them.

Any suggestions? Thanks.

Jashua Ni
Does anybody encounter read errors when read from original db file?

I could not get the magic number, length of record in bytes, etc. in the header?

Any suggestions?

Thanks.

Jashua Ni