Implenting ActiveRecord with inheritance?
- by King
I recently converted an old application that was using XML files as the data store to use SQL instead. To avoid a lot of changes I basically created ActiveRecord style classes that inherited from the original business objects.
For example
SomeClassRecord :SomeClass
//ID Property
//Save method
I then used this new class in place of the other one, because of polymorphism I didn't need to change any methods that took SomeClass as a parameter.
Would this be considered 'Bad'? What would be a better alternative?