wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Extending Vs Modifying Data Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Extending Vs Modifying Data Class" Watch "Extending Vs Modifying Data Class" New topic
Author

Extending Vs Modifying Data Class

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello All,
I am a bit confused about the following requirement

Part of your assignment will be to enhance the Data Class. You may do this by modification or subclassing, but you should document the approach and reason for your choices.

I think when I change the deprecated methods in the Data class I am enhancing the Data class. I am also planning to have a common interface DataAccess that has all the methods of the Data class. So in this case will I be subclassing the Data class? Also does the Data Class have to implement the DataAccess interface?
Thanks
-Amish
Bernhard Woditschka
Ranch Hand

Joined: Sep 16, 2002
Posts: 89
I think modifying the deprecated code is maintenance as it preserves the signature and behaviour of the Data class.
Adding the new functionality (lock, unlock, criteriaFind) is a different topic.
Bern
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
So regarding lock, unlock and criteriaFind I have two options.
1) Is change the Data class and add these methods to it.
2) Extend the Data class and add these methods to a subclass to the Data.
Is this what you mean?
-Amish
Originally posted by Bernhard Woditschka:
I think modifying the deprecated code is maintenance as it preserves the signature and behaviour of the Data class.
Adding the new functionality (lock, unlock, criteriaFind) is a different topic.
Bern
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Please help!
Bernhard Woditschka
Ranch Hand

Joined: Sep 16, 2002
Posts: 89
Not exactly.
What I tryed to say is:
Step 1) you just 'maintain' (i.e. modify the existing Data class) and replace depricated code, add/correct javadoc...
Step 2) You decide wheather to add new functions by changing the class or subclassing it
Step 3) You implement the new funcions in the Data class or a subclass.
The important part is that Step 1 is maintenance of the ecisting class and Step 2 & 3 is extending the functionality.
Hope this helps
Bern
[ January 22, 2003: Message edited by: Bernhard Woditschka ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extending Vs Modifying Data Class
 
Similar Threads
Design Choice...(Post your opinions)
FBN GUI
Design issues
FBN Architecture Query
isLock(int):boolean method and the synchronized block