How to change behaviour of your software


Almost always you end up realizing that the software you have built required some significant change. I have been studying very deeply as to how I can minimize that additional work that I end up doing.

I have found that the best way to ensure that your code can be adapted to completely new set of requirements is by following the below mentioned rules.

1. Almost everything should be possible to to change just via configuration parameters.

2. Whatever that can not be changed/added via configuration properties alone should be changed via Inheritance

3. Whatever that can not be changed/added via inheritance must be changed via Composition

4. Only when all these attempts fail one should look at writing fresh code.

This is a very simple learning but the worst bad habit that most developers have is that of hard-coding everything. That is why we end up doing a lot of nonsensical work later.

 

Advertisements

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s