Ever wonder why Design Patterns name? And why so many? Why all seem to be relatable?
Means I get such thoughts million times & many times I try to understand these to find the
clear separations but every time I get confused, as by names above 3 patterns look different,
their motives are different but still I see the similarity & till date I find it difficult to differentiate.
If one would like to help me here, please comment with details.
Sometimes, I feel it has been the fantasy of humans to give names to each of their creation,
whether it is their children or some code snippet.
Below is one example, you can think about in your work at least. I see it a good way to relate
two objects but still keeping them independent of some concrete implementations & think to
provide different strategy or get your code executed some where else.
Means it is worth to be aware about-
Means I get such thoughts million times & many times I try to understand these to find the
clear separations but every time I get confused, as by names above 3 patterns look different,
their motives are different but still I see the similarity & till date I find it difficult to differentiate.
If one would like to help me here, please comment with details.
Sometimes, I feel it has been the fantasy of humans to give names to each of their creation,
whether it is their children or some code snippet.
Below is one example, you can think about in your work at least. I see it a good way to relate
two objects but still keeping them independent of some concrete implementations & think to
provide different strategy or get your code executed some where else.
Means it is worth to be aware about-
Pattern?
If I see the above code from PersonExecutor.java, then my logic doesn't know on which object it will be executed. Similarly if I see from TemplateMethod.java, I don't know for what logic my
Person object will be used.
But point is, both the classes know those are working on Person type objects & thats the link I
see as the connecting point.
One use case - In the DB access layer in your application.
This way you can create the transaction statements at one place & create DB connections in
other class.
So this was a little thought I wanted to share here.
Person object will be used.
But point is, both the classes know those are working on Person type objects & thats the link I
see as the connecting point.
One use case - In the DB access layer in your application.
This way you can create the transaction statements at one place & create DB connections in
other class.
So this was a little thought I wanted to share here.