Welcome Guest, Not a member yet? Register   Sign In
Forcing subclass to override method (WITHOUT USING ABSTRACT)
#1

[eluser]blasto333[/eluser]
Ok this might sound like an odd example where I want to force a subclass to override a method of a base class (which has implementation)

I have a Person Model (Superclass)
* exists
* get_all

* get_info
* get_multiple_info
* save
* delete
* delete_list

Then the sub classes

Customer extends Person

Employee extends Person

I want subclasses to overwrite the methods in red, but I don't want to make the model abstract because I have a need to make Person objects to use methods such as get_info and get_multiple info (without knowing if I have a customer or employee)

Is there a way to do this besides just remembering?




Theme © iAndrew 2016 - Forum software by © MyBB