For example, I have something like this:
User
-FirstName
-SecondName
-Gender
and VIPUserwhich is a subclassUser
VIPUser extends User
-GiftNum
-Birthday
But suddenly, the application must change the policy, everyone Usershould have Birthday.... And this is not an optional field that no longer allows you nullto set for the user, it becomes MUST fills the variable for the new register User, but I can stay nullfor the existing user ...
So, I will need to change the whole creation method Userand pass Birthday, it includes many codes. How can I make it more convenient for maintenance? Thank.
source
share