Skip to content

Project that holds a view examples of the famous design patterns in java

License

Notifications You must be signed in to change notification settings

lightblueseas/design-patterns

Repository files navigation

design-patterns

This project holds view design patterns in java that have the target to be generic and educational.

Here a some design patterns that this library holds:

  • builder
  • command
  • eventbus (new)
  • observer
  • state
  • strategy
  • visitor

License

The source code comes under the liberal MIT License, making design-patterns great for all types of applications.

Build status and latest maven version

Java CI with Gradle

Maven Central

  • builder Maven Central
  • command Maven Central
  • decorator Maven Central
  • eventbus Maven Central
  • observer Maven Central
  • state Maven Central
  • strategy Maven Central
  • visitor Maven Central

gradle dependency

You can first define the version and add than the following gradle dependency to your project build.gradle if you want to import the core functionality of all design-pattern:

define version in file gradle.properties

designPatternsVersion=6

or in build.gradle ext area

ext {
			...
    designPatternsVersion = "6"
			...
}

then add the dependency to the dependencies area


dependencies {
			...
    implementation("io.github.astrapi69:builder:$designPatternsVersion")
    implementation("io.github.astrapi69:command:$designPatternsVersion")
    implementation("io.github.astrapi69:decorator:$designPatternsVersion")
    implementation("io.github.astrapi69:eventbus:$designPatternsVersion")
    implementation("io.github.astrapi69:observer:$designPatternsVersion")
    implementation("io.github.astrapi69:state:$designPatternsVersion")
    implementation("io.github.astrapi69:strategy:$designPatternsVersion")
    implementation("io.github.astrapi69:visitor:$designPatternsVersion")
			...
}

Maven dependency

Maven dependency is now on sonatype. Check out sonatype repository for latest snapshots and releases.

Add the following maven dependencies to your project pom.xml if you want to import the core functionality:

You can first define the version properties:

<properties>
		...
	<!-- DESIGN-PATTERNS version -->
	<design-patterns.version>6</design-patterns.version>
	<builder.version>${design-patterns.version}</builder.version>
	<command.version>${design-patterns.version}</command.version>
	<decorator.version>${design-patterns.version}</decorator.version>
	<eventbus.version>${design-patterns.version}</eventbus.version>
	<observer.version>${design-patterns.version}</observer.version>
	<state.version>${design-patterns.version}</state.version>
	<strategy.version>${design-patterns.version}</strategy.version>
	<visitor.version>${design-patterns.version}</visitor.version>
		...
</properties>

Add the following maven dependency to your project pom.xml if you want to import the functionality of builder:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>builder</artifactId>
			<version>${builder.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of command:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>command</artifactId>
			<version>${command.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of decorator:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>decorator</artifactId>
			<version>${decorator.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of eventbus:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>eventbus</artifactId>
			<version>${eventbus.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of observer:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>observer</artifactId>
			<version>${observer.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of state:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>state</artifactId>
			<version>${state.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of strategy:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>strategy</artifactId>
			<version>${strategy.version}</version>
		</dependency>
		...
	</dependencies>

Add the following maven dependency to your project pom.xml if you want to import the functionality of visitor:

Than you can add the dependency to your dependencies:

	<dependencies>
		...
		<dependency>
			<groupId>io.github.astrapi69</groupId>
			<artifactId>visitor</artifactId>
			<version>${visitor.version}</version>
		</dependency>
		...
	</dependencies>

Want to Help and improve it?

The source code for design-patterns are on GitHub. Please feel free to fork and send pull requests!

Create your own fork of lightblueseas/design-patterns/fork

To share your changes, submit a pull request.

Don't forget to add new units tests on your changes.

Contacting the Developer

Do not hesitate to contact the design-patterns developers with your questions, concerns, comments, bug reports, or feature requests.

  • Feature requests, questions and bug reports can be reported at the issues page.

Note

No animals were harmed in the making of this library.

Donations

This project is kept as an open source product and relies on contributions to remain being developed. If you like this library, please consider a donation

over paypal:

PayPal this

or over bitcoin(BTC) with this address:

bc1ql2y99q7e8psndhcc3gferk03esw3qqf677rhjy

Donation Bitcoin Wallet

or over FIO with this address:

FIO7tFMUVAA9cHiPPqKMfMXiSxHrbpiFyRYqTketNuM67aULuwjop

Donation FIO Wallet

or over Ethereum(ETH) with:

0xc057D159D3C8f3311E73568b334FF6fE82EB2b7D

Donation Ethereum Wallet

or over Ethereum Classic(ETC) with:

0xF708cA86D86C246B69c3F4BAe431eBbe0c2bfddD

Donation Ethereum Classic Wallet

or over Dogecoin(DOGE) with:

D5yi4Um8cpakd6yPRm2hGWuQ5nrVzhSSW1

Donation Dogecoin Wallet

or over Monero(XMR) with:

49bqeRQ7Bf49oJFVC72pqpe5hFbb62pfXDYPdLsadGGF81KZW2ZfrPZ8PbAVu5X2v1TYAspeczMya3cYQysNS4usRRPQHVw

Donation Monero Wallet

or over flattr:

Flattr this

Similar projects

Here is a list of some other awesome projects for design patterns:

About

Project that holds a view examples of the famous design patterns in java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages