This is one of the common questions to any software developer, whenever talk to their friends, mates or in an interview.. OK, is it really needed to use design patterns in your project? – My answer is Yes and No.
No is because: As long as you know what is required for the current project and the code you are writing gives solution to the problem and completes the expectation of project requirements.
Yes is because: I would underline the words “expectation of project requirement” because this would drive us to use some of the design patterns in our project. Now a days most of the project requirements leads us to go with some of the mostly followed or recent successful architectural patterns say SOA, Multi tier architecture, MVC, Analytical reporting and more. Architectural patterns are seen as commonality at higher level than design patterns. Architectural patterns are high-level strategies that concerns large-scale components, the global properties and mechanisms of a system.
When we follow some of the architectural patterns and get into a lower level design, it might lead you to apply some design patterns, say we have decided to start a project in Multi-tier architectural pattern and we want all the tiers to be loosely coupled here we need not reinvent the wheel to achieve this as there are some successful design patterns already available for achieving this case.
Also not just the architectural patterns lead you to apply design patterns, the common factors which lead us to apply design patterns are
- Re-use
- Classification and
- Abstracting the commonality
Say we read configuration files in common for all the projects irrespective of whatever the architectural patterns are followed for that project. In this case I would use singleton pattern as i need the object to be initialized only at the start of project and would use it across.
Still using the right design pattern at the right place is very important and there could be multiple patterns available for the same scenario too. The choice of design pattern should justify, why this design pattern to be considered a good solution.
I will try to post some of the scenario and why I choose a specific design pattern on that scenario, in my future posts.
Feel free to share your comments here.
Congratulations @sabarirajan.guru! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit