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

Contractor Project Data.java and Facade Design

 
Guido Tapia
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apologies for the length of this post.
I'm currently polishing off my assignment and I'm thinking of changing my Data Access design. Currently I have the Data class implemented as per the specifications provided. But I have built a Facade over this that keeps the database information in memory and update both (memory and database) when an updates (deletes, etc) are made.
The benefits of this are ofcourse performance (especially for just reading) and the ability to hide many complexities of the Data class, such as working with a Data object rather than String arrays.
However I have had to map (hard code) the schema information in my Data Object so as I know where the name, location, etc goes in the record. This seems like a poor design as I have now stopped my database schema from being changed. I have also put a limit of the number of records that can go in the database (since I am using memory) this also seems like a flaw.
What I was thinking of doing now is to keep the Facade but only as a conduit to the Data class. This means that I will lose the performance benefits but will still be able to use Data objects rather than String arrays.
Any comments? Suggestions?
Thanks.
GT
 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guido Tapia,
Make the design as simple as possible with in reach of good OO programming. Also there is one condition that code should be easily understood by junior programmers.
what data object are you using?
and how you are processing it?
Regards,
Ganapathy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic