• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

data class question

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the assignment, it writes "... enhance the Data class. You may do this by modification or subclassing, but you should document the approach and reason for your choice."
Can I do both i.e. modification and subclassing?
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to specify one or the other. They are interested in your reasons. It goes without saying that if you subclass it, you are going to modify it. I chose not to subclass. Why? Because the project as given was incomplete and was specialized to a particular database. If it had been generalized, and you needed to make mods in order to have it work with the db.db datastore, then it would have been wise to subclass.
 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I perferred modify the Data class over extending it. I think you can do whatever you want, as long as you give a reason for doing so, and it must be based on OOAD principle.
 
I'm doing laundry! Look how clean this tiny ad is:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic