See books in /books
directory
See principles of programming in /principles
directory
- Adapter
- Builder
- Chain of Responsibility
- Composite
- Decorator
- Factory Method
- Observer
- Prototype
- Singleton
- Strategy
patternsHelp - Prints all generated tasks for patterns
# Input:
./gradlew patternsHelp
# Output:
adapter
build :adapterBuild
jar :adapterJar
run :adapterRun
clean :adapterClean
# and so on...
patternsRunAll - Runs all :*Run tasks of patterns
# Input:
./gradlew patternsRunAll
# Output:
:adapterBuild
:adapterJar
:adapterRun
# and so on for each pattern...
patternsCleanAll - Runs all :*Clean tasks of patterns
./gradlew patternsCleanAll
To register a pattern use following function in build.gradle
def pattern(String dirName, String taskPrefix = null) {}
- dirName - Directory which contains source code of pattern
- taskPrefix -
[Optional]
Prefix of generated tasks of each pattern. Default value is equal todirName
It registers four tasks associated with the pattern. They have the following format (see short descriptions):
<taskPrefix>Build
- Compiles sources files intobuild/classes/<dirName>/<dirName>/
<taskPrefix>Jar
- Builds compiled class files into a single jarbuild/libs/<dirName>.jar
<taskPrefix>Run
- Runs the generated jar file<taskPrefix>Clean
- Cleans generated files
Each directory of pattern MUST have Example
class because it is considered as initial point
Note #1: Some of examples are taken from external resources.
Note #2: The repository is open to modifications.