• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data.java

 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My instructions say
Three classes are in this package: Data, DataInfo, and FieldInfo. With the exception of three methods, noted below, these classes are complete and functional, and you have the source code for them. Any additional classes you create that are related to the database should be placed in the suncertify.db package.

Does it mean that Data.java has to be in suncertify.db package only. I see it more as a "server" code rather than "database related" code. Would it be a problem if I move it to some other package other than duncertify.db?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Data is db. So it makes 100% sense to be in the suncertify.db package only.
Mark
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prakash,
As Mark said, Data is db.
That is, Data is only concerned with how to put data into and get data out of the database.
Data is not concerned about what classes are connected to it, or how they are connected. It has no concept of being a server - you should be able to use a server with it, or you should be able to connect directly with it. It should not be a server itself.
If you have a package for server classes (I do), then the classes in it are only concerned with serving connections - they do not have any idea of how the data is stored, where it is stored, etc.
Regards, Andrew
 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark, Andrew,
I put my class that manages the server connections and the Lock Manager in the server package.
After your suggestions, I am thinking if lock manager needs to go in suncertify.db instead of the server package?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prakash,
Since your LockManager is a helper class to the Data class, and not used by any other classes, then I agree that it should be in the suncertify.db package.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic