From our childhood, we hear a lot of things about “Factories”, some are good and most of them are bad. That too if you are coming from a country like India, you will hear more bad stories of the factories destroying the communities and health.
In my own experience, I have heard a lot of criticism on factories, like they spoil the environment, contaminate the water, air and soil and devastation of the crops. When compared to the opportunities these give to the jobless the devastation gains and protests start.
Luckily, in Software development the “Factories” are doing the quite opposite of the physical “Factories” around the globe. As I have said above the “Factories” we are talking about reduces the pollution, improves the quality and gives more opportunities. (Ok finally one thing in common).
So now, have you started to think like me, how does these Factories stop Pollution and Improve the quality. Let me tell you about how did I concluded this. But before that, I request you to go through this “use case and factory pattern implementation in github” * and understand about the software Factories
* Descriptive enough for me , but if you feel otherwise please let me know how to improve it.
First Statement (Reduces the Pollution)
As given in my code, the factories reduces polluting your code (and in turn client code) by giving a clear way for adding and removing support of the services.
Adding or Removing of services will not mandate the client to alter his code, which helps in maintaining Loose Coupling.
Client does not need to pollute his code, whenever you alter your system.
Second Statement (Increase the Quality)
Since the factories allows you to develop code with loose coupling and high cohesion, your code will be more readable and maintainable.
As less or no changes are required at the client for any new changes, there is a minimal chance of getting any new issues for the client.
Third Statement (Increase Opportunities)
Adding a new Service and announcing it to the client is much easier with the factory approach, and creates more customer satisfaction.
After all having factories is not so bad, at least in the software development. And yes since we are geeky we should not just care about the “Factories” in our coding / testing environments, let us start thinking of how to improve the Physical factories and come up with some good ideas to improve the LIVING environment.
So, now do you [dis]agree with me, whatever is your thought, give it some light and let me know in the comments.