• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Extending Vs Modifying Data Class

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help!
 
Bernhard Woditschka
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic