• 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

data.java

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Data is db. So it makes 100% sense to be in the suncertify.db package only.
Mark
 
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 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic