Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help!!

 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have the following structure
1) suncertify/db folder contains Data class, db.db, LockManager, FieldInfo, DataInfo...etc etc
2) clientside folder which contains classes DataClient(which is almost the same as the Data Class), which implements Data interface and the other classes like DataFactory.
The problem that I am facing right now is that DataClient class implements the DataInterface. So DataClient has methods like criteriaFind, getRecord() etc which access the db.db and need DataInfo and FieldInfo classes. So I am forced to keep a local copy of DataInfo and FieldInfo. Also, since in my DataInterface I am declaring the methods criteriaFind, add()..etc to throw a DataBaseException, I am also forced to keep a copy of DataBaseException locally. When I mean locally I mean under the clientside folder. I am having a miserable time managing this.

Can anybody suggest me a better way of doing this?

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is DataClient really a class that belongs in the Client package, or does it really belong to the db package. That is really your question. Now any class can always import classes from other packages. So the question is what do you want to do? And what feels right to you?
Mark
 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Now any class can always import classes from other packages.

What you are saying is right, but since I kept the db.db file in the server folder importing that from the server folder did not make a lot of sense to me. Because if it is a local mode then i do not wanna be talking to classes and the database that exist on the server. Which would then need me to keep a local copy of data class (which I am calling dataclient) and so on and so forth....
Keeping a common area would make better sense here, is what I think.....
When I mean common area what I mean is a db folder with the fieldInfo and DataInfo class and db.db....
What do you guys think? any opinion would be appreciated.
 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, is there any restriction as far as moving about the java files supplied to us(Data.java, FieldInfo.java...) to packages we may deem appropriate?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about just placing your db.db file in your root directory? Since that is where everything is going to be started from anyway.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic