*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:Discuss the new data access design 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 "NX:Discuss the new data access design" Watch "NX:Discuss the new data access design" New topic
Author

NX:Discuss the new data access design

Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
After studying some base points of Java 2 SDK,I start to learn designing my database schema.
Considering some experiences from posts of other experts,I attempt to list the main required parts in the assginment,as follows:
------------------------------------------------------------------------
1.public interface DBAccess--->required from instructions.html and provided unimplemented methods by it.
2.public class Data--->it must implement the DBAccess interface.
3.public interface DBRemoteAccess--->it contains all methods provided by DBAccess interface,and extends Remote interface.
4.public class DBRemoteAccessImpl--->it implements DBRemoteAccess interface and extends UnicastRemoteObject class.
5.public class DBServer--->it register a server object with RMI technology so that the client can find the server through remote access.
6.public class DBClient--->it look up the server object and finish the network connection so as to implement the remote data access function.
7.other supporting files such as introduction documents and Properties...
--------------------------------------------------------------------------
Please interested friends help me to criticize and correct that.
Thanks in advance.
Regards,
Richard.
*-----------------------------*----------------------------------*
Believe your common efforts is leaving,future achievement is coming.


Regards, Richard
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Richard,
This sounds like a reasonable start. Without knowing the exact instructions you have it is impossible to state whether this will require any changes or not.
You may find that this works all the way through to your final submission, or you may find that part way along you want to refactor. Personally I would not get too hung up on trying to get a perfect plan in place now - start with what you have (as I said, it does look reasonable) and only worry about changes if you find later that you need any.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Hi,Andrew,
Thanks for your sincere reply again.
In my instructions.html,there are statements that describe as below,
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
package suncertify.db;
public interface DBAccess
{
// Reads a record from the file. Returns an array where each
// element is a record value.
public String [] readRecord(long recNo)
throws RecordNotFoundException;
... ...

Because this project is a URLyBird assignment,it has still parts about Data File Format;
Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
2 byte numeric, number of fields in each record
Schema description section.
Repeated for each field in a record:
1 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name
1 byte numeric, field length in bytes
end of repeating block
Data section.
Repeat to end of file:
1 byte flag. 00 implies valid record, 0xFF implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information
End of file

Here,we can see a clear structure about content.But I haven't had effective ways to implement.
So firstly,I assume that above architecture for my assignment,though I know that some required classes (e.g. DBAccessGUI.java and DBAccessController.java maybe required)aren't contained into that.
From the first step,how can I walk into continually?
Please lead me clearly.
Regards,
Richard.
Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Another problem that I just forgot to post is:
3.public interface DBRemoteAccess--->it contains all methods provided by DBAccess interface,and extends Remote interface.

I can't sure whether it is true.
Doesn't it really affect the database function in the application?
Have you had other better plan to satisfy the need?
Regards,
Richard.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Richard,
I think you are getting ahead of yourself. In this thread you are trying to work with the low level data access routines. I think you should concentrate on getting that working before going too deep into the architecture of the entire application.
So I am ignoring these questions temporarily and continuing with the basic database issues in the other thread. When you are happy with your Data class, then you might want to come back and revisit the issues in this topic.
Regards, Andrew
Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Hi,Andrew

I think you should concentrate on getting that working before going too deep into the architecture of the entire application.

Great suggestion!I agree with you actually.
Because I don't want to leave some doubtful points in my brain,as the reason,I am anxious to know every details about Java.
This is the purpose that I really understand the relevant Java technologies.
I will try again and again.
At the same time,it's my pleasure to meet you all experts.
I just waiting for [I]happy with my Data class{/I]...
Regards,Richard
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX:Discuss the new data access design
 
Similar Threads
RMI Security Exception
Comments of the given interface
NX: RemoteDBAccess
B&S : Couple of questions
B&S 2.2.2 - Network Layer Query