posted 15 years ago
Dear all
I have some querstion for design.
If I have a function , it will return person information including name,mail and personNo.
So the function will be as below
But now I have a new user request , it only needs the persion information including name and mail.
Question 1 :
Should I reuse the existing funciton? It includes all the information but the personNo is unnecessary;
Will I violate information hiding If I reuse the existing function?
Question 2:
I can remove the uncessary information by writing new funciton as below.
This way will be good for information hiding.
But there are many dumb new function should be writed when users raise similar requests.
Can combody give me a suggestion how should I do in this situation?