For example, I have something like this:
User
-FirstName
-SecondName
-Gender
and the VIPUser
, which is the subclass of User
VIPUser extends User
-GiftNum
-Birthday
But suddenly the application need to change the policy, all the User
must have the Birthday
.... And it is not a optional field, which not allow to set null
anymore for user, it becomes the MUST fill in variable for the new register User
, but I can remain null
for the existing user...
So, I will need to change all the User
creation method, and pass the Birthday
, it involves lot of codes. How can I make it more maintainable? Thanks.