Originally posted by Quintin Stephenson:
Hi All
I've gone for a dynamic approach with regards to the shema in a similar manner at Edwin. I read the meta data in the header and create a schema object. This object contains all the information that will dictate everything with regards to data (ie. data type, length postion in of column per records etc) and will ensure data ways ends up in the correct position in the datafile. It will also be used to affect my MVC model for the displayed GUI to my users.
My analysis of the data file gave me similar questions and conclusions(by the sounds of it) to Edwin. What redesign work would I have to go through if a new column was added (e.g. in my assignment I can see a need for a phone number column to be added). By the sounds of it some people are going for similar solutions to Andrew Monkhouse's book solution using a traditional hard coded Transfer Object design pattern.
I think you should be fine as long as you can justify it and remember to document it in your choices document as this is a major part of your assignment (your thought process and why you did certain things).
Cheers
Q
I am also doing the B&S assignment. For this schema object, how did you implement this schema object? I thought about:
- making the Schema object a singleton class so that metadata can be loaded only once (preventing unnecessary calls to loading metadata everytime a client accesses the database), and it can be made accessible throughout the entire application. But I came to the conclusion that we have a data layer interface for database operations, so having a singleton Schema object in the data layer kinda goes in the opposite direction.
- making a new interface called Metadata, which the Data class implements in addition to DBMain. The interface contains methods like getColumns() etc. The problem is that I don't know how to prevent unnecessary calls to loading metadata everytime a client connects to the database (ideally I only want metadata to be loaded once and once only), and I'll need to have two references to the interface to call the data layer (DBMain and Metadata), when ideally I would only really want one.
What have others implemented? Please share your ideas. Thanks