• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NX:Discuss the new data access design

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Richard Jackson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic