File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: database schema problem

 
Gytis Jakutonis
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm having problem with databa schema. Assignment document contains list of fields, but I'm not sure about fields order - can I rely on assignment document and access fields in this manner: String[name_index], where name_index = 0 is constant? I'm talking about complex meta-data approaches, I'm just curious if somebody was able to pass with hardcoded constants instead of database file header schema based approach? While database schema approach is more flexible, it requires either to expose database schema information to gui tier or wrap schema into business level proxy/adapter.
 
Hanna Habashy
Ranch Hand
Posts: 532
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Gytis
As far as I know, there are some people passed with hard coded field names. However, IMO it is not a good software design. If you hard code the field names and position within a record, then your program is bound to this database only, and cann't be reused if the database is modified. which defeats the purpose of OOP.
Reading the schema dynamicaly, and customizing the software to accommodate the new database file is the approach I used designing my project. I used what you called it proxy/adaptore for the metadata. However, I am not done with the project yet. I have just finished the data access layer, and I am going to start on GUI sometime soon. So, I don't know how dificult or easy it will be.
good luck
 
Gytis Jakutonis
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hanna,
I totally agree with you that hardcoding record structure is not the perfect solution. But could we take a look at the requirements: there is no requirement to respond to database format changes, but there are notes that system will not be reused in future and is for learning purposes mainly. Now just imagine junior programmer, looking at those meta-data trikcs - he/she will be confused, I guess.
One more note - how many applications you have wrote, which respond to underlying database changes? None for 99% from all cases, I guess.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic