It is for this reason that I created PerfectJPattern . Just remember to check and understand the code examples. They are available for download, as well as on the site documentation pages for each of the template implementations. If you read the GoF book, you will easily understand examples.
For example, if you want to use the Composite Pattern in your code, and if you use PerfectJPattern , you only need to specify which interface (general parameter and class instance) that you would like to use as Composite, and the rest is provided to you, see PerfectJPattern Composite At the bottom of this page is a working example that shows how to do this.
Another aspect that you should also consider is that in PerfectJPattern you don't have to reuse common template implementations (e.g. perfectjpattern-core Maven submodule), you also have the choice of only reusing a pure abstract level (perfectypattern- api Maven subodule) and provide the implementation yourself. In PerfectJPattern , you have the flexibility of reusing at different levels of abstraction, since there is a fine-grained layered structure also reflected in the structure of the Maven project. Reusing perfectjpattern-api gives you an abstract template directive if you want, which will help you speed up the implementation of your own Design Pattern templates . However, ideally, you should use it as much as possible.
Update. Following the comment below, it is worth noting that not all templates can be fully compotentized; see From templates to components . Some templates can only be partially detailed, and some others are not at all similar to the Singleton case. Singleton is too context sensitive and therefore you can find the PerfectJPattern interface. However, in PerfectJPattern, the following templates are completely components, for example. Observer, Command, Adapter, Decorator, Composite, Proxy, Visitor, DAO, etc.
Giovanni azua
source share