• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extending vs. Changing the Data class

 
Marre Mask
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any good thoughts on this subject. The only think that directly pops up in my mind is that it's unnecessary to extend the Data class and therefor make it impossible to extend anything else.
 
death pac
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mask ,
what they mean by extending the data class ,is that u need to implement the lock unlock and critireaFind in another class which extends Data class !
i dont think its necessary bcoz , Data class as the class description say's
"Provides basic database services "
Lock / unlock and search are normal database functions .Hence i thought it would be better to implement them in the data class rather than extending it !This is my point of view ....there might be someone who could find advantages to extending the Data class .But as long as u are able to justify what u did i your design doc things should be fine !!
cheers

amjad
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As data is a purely local implementation, it does not appear to have any need for a lock()/unlock() implementation.
- Peter
 
Rick Fortier
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not implement lock/unlock in Data. I implemented it in a class only used by my server interface.
 
Ana Inna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick and Peter,
I completely agree with your opinion that the locking mechanism should not be implemented in Data class. Thus, i have created a ceparate singlton class that takes care of record locking. But now when I am at the point of writing the client i run into a problem: what type should be the reference that during runtime gets assigned either Data type or DBRemoteImplementation type depending on under which mode the user is running the program?
U suspect that you take care of locking on the server side whereas I attempt to do it in my client class.
I have the following structure of the system:
Data implements DBInterface;
DBRemoteInterface extends Remote, DBInterface plus defines signatures forlock and unlock methods;
DBRemoteImpl class implements DBRemoteInterface and while implementing lock and unlock aquires a single instance of the Locker class.
Could you please comment on my problem.
Ana
 
SAFROLE YUTANI
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To all of you trying to make sense of this, I can tell you right now, after passing the test, that it makes absolutely no difference which method you choose. You can extend the functionality of Data, or create a new class to handle locking, or implement locking in the Data class itself You can even write a class that models your kitchen sink and place that inside Data as an inner class, just make sure you can justify your choice of design because one of the essay questions in Part 2 will ask you which method you choose and why!
Good luck,
SAF
 
Mike Wiegand
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Safrole,
I really enjoyed your reply in the midst of all this seriousness!!!
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic