Don’t create “poltergeist” classes.

They’re useless.

These classes have no responsibility and just call methods in other classes.

You can usually replace these classes with calls to the delegate class directly.

Sometimes, developers implement these classes in anticipation of a future need for a more complex structure. This technique is not a good practice. Don’t write code in anticipation of possible future needs. Code for today, to meet the current requirement, to pass the tests.

See also “YAGNI.”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: