Invoque a Save method from child class


New member
Apr 22, 2010
Programming Experience
Hi all,

I've been working with a lot of APIs from diferent products. Now that I'm building my own, I have a .... 'arquitecture issue'.

What I see in others and try to imitate is:

CoreAnimalEngine (a class that manages all. The collections of items and most important, all the activity to Database).

This CoreAnimalEngine has 3 animal instances "Dog, Cat, Horse".

How can I implement a Dog.Save (in the animal class instead of in CoreanimalEngine), if the connection to database and all the application control belongs to Dog's father class CoreAnimalEngine?

I want my API to be used this way

dim mCore as New CoreAnimalEngine
dim mDog as new Animal = mCore.getAnimal("dog")
mDog.EjeColor = "blue"

That's it.

hope my explanation helps ;))

Thanks a lot!
Top Bottom