Feature envy is one of the bad smells in Martin Fowlers?s codesmells. Feature envy describes a situation
Fantastic news! We've Found the answer you've been seeking!
Question:
Feature envy is one of the bad smells in Martin Fowlers?s codesmells. Feature envy describes a situation in which one object getsat the fields of another object to perform some sort of computationor make a decision, rather than asking the object to do thecomputation itself. Inthe Customer class below, themethod getMobilePhoneNumber()provides a NorthAmerican-formattedmobile Phone number.
Note: Suppose the customer class is createdseparately.
Note: Suppose the customer class is createdseparately.
Rewritethe Phone and Customer classto remove the ?feature envy? bad smell improving thecode. [12-Marks]
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date: