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

Dynamic record object

 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have this idea and I'd like to know if anybody thought about it so far. I know how to implement it; I just want to find out if this is a good aproach from the exam point of view.
I want to have a Contractor class that will keep as member variables all the data for a particular record in the database (name, etc). I'd like to have this done dynamically, depending on the current database schema. That means, whenever I instantiate this object I will have to pass a reference of the database schema. The pair (fied_name, value) will be stored internally in each Record.
This will provide a great flexibility of the database schema change. Should another field is inserted into the database, the Record will know about it, the GUI interface will know (and will display it). Minimum impact on refactoring the code, affecting the users.
Is it worth the effort?
Thanx,
Adrian
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adrian,
Sounds like a "Value Object".
Several people have done this. The question you have to decide is where you convert from the output provided by the Data methods into your Value Object. And that possibly depends on whether you are having a fat client or a thin client.
Regards, Andrew
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Adrian,
I join to Andrew statements. I 've done it on the client.
Best,
Vlad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic