Java Patterns
A collection of common design patterns for Java.
Not all the design patterns have been included in this library. This is a compilation of only those which I've needed, and only if there wasn't any available implementation for them.
For each of them an interface and, when possible, also a basic implementation are offered.
Features
Currently the patterns included are as follows:
- The Command, and the CommandExecutor, help to encapsulate code inside an object.
- The Outputter allows writing for files, or just sending structures, without worrying about the actual implementation.
- The Parser transforms one object into another, keeping as much of the data intact as possible.
- The Prototype permits creating an identical copy of a base template.
- The Repository allows handling data persistence as if you were working on a collection.
Documentation
Documentation is always generated for the latest release, kept in the 'master' branch:
Documentation is also generated from the latest snapshot, taken from the 'develop' branch:
The documentation site sources come along the source code (as it is a Maven site), so it is always possible to generate them using the following Maven command:
$ mvn verify site
The verify phase is required, as otherwise some of the reports won't be created.
Usage
The application is coded in Java, using Maven to manage the project.
Prerequisites
The project has been tested on the following Java versions:
- JDK 7
- JDK 8
- OpenJDK 7
All other dependencies are handled through Maven, and noted in the included POM file.
Installing
The recommended way to install the project is by setting up your preferred dependencies manager. To get the configuration information for this check the Bintray repository, or the Maven Central Repository.
If for some reason manual installation is necessary, just use the following Maven command:
$ mvn install
Collaborate
Any kind of help with the project will be well received, and there are two main ways to give such help:
- Reporting errors and asking for extensions through the issues management
- or forking the repository and extending the project
Issues management
Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.
Getting the code
If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the 'master' branch for the latest release, and the 'develop' for the current, and stable, development version.
License
The project has been released under the MIT License.