GithubHelp home page GithubHelp logo

iluwatar / java-design-patterns Goto Github PK

View Code? Open in Web Editor NEW
89.0K 3.8K 26.4K 33.97 MB

Design patterns implemented in Java

Home Page: https://java-design-patterns.com

License: Other

Java 99.37% HTML 0.39% CSS 0.23% Shell 0.01%
java principles design-patterns awesome-list snippets snippets-collection snippets-library hacktoberfest

java-design-patterns's Introduction

Design Patterns Implemented in Java

Java CI License MIT Lines of Code Coverage Join the chat at https://gitter.im/iluwatar/java-design-patterns

All Contributors


Read in different language : zh, ko, fr, tr, ar, es, pt, id, ru, de, ja, vi, bn, np, it, da

Introduction

Design patterns are the best, formalized practices a programmer can use to solve common problems when designing an application or system.

Design patterns can speed up the development process by providing tested, proven development paradigms.

Reusing design patterns helps prevent subtle issues that cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.

Getting Started

This site showcases Java Design Patterns. The solutions have been developed by experienced programmers and architects from the open-source community. The patterns can be browsed by their high-level descriptions or by looking at their source code. The source code examples are well commented and can be thought of as programming tutorials on how to implement a specific pattern. We use the most popular battle-proven open-source Java technologies.

Before you dive into the material, you should be familiar with various Software Design Principles.

All designs should be as simple as possible. You should start with KISS, YAGNI, and Do The Simplest Thing That Could Possibly Work principles. Complexity and patterns should only be introduced when they are needed for practical extensibility.

Once you are familiar with these concepts you can start drilling down into the available design patterns by any of the following approaches:

  • Search for a specific pattern by name. Can't find one? Please report a new pattern here.
  • Using tags such as Performance, Gang of Four or Data access.
  • Using pattern categories, Creational, Behavioral, and others.

Hopefully, you find the object-oriented solutions presented on this site useful in your architectures and have as much fun learning them as we had while developing them.

How to Contribute

If you are willing to contribute to the project you will find the relevant information in our developer wiki. We will help you and answer your questions in the Gitter chatroom.

The Book

The design patterns are now available as an e-book. Find out more about "Open Source Java Design Patterns" here: https://payhip.com/b/kcaF9

The project contributors can get the book for free. Contact the maintainer via Gitter chatroom or email (iluwatar (at) gmail (dot) com ). Send a message that contains your email address, Github username, and a link to an accepted pull request.

License

This project is licensed under the terms of the MIT license.

Contributors

Ilkka Seppälä
Ilkka Seppälä

📆 🚧 🖋
Subhrodip Mohanta
Subhrodip Mohanta

💻 👀 🚧
amit1307
amit1307

💻
Narendra Pathai
Narendra Pathai

💻 🤔 👀
Jeroen Meulemeester
Jeroen Meulemeester

💻
Joseph McCarthy
Joseph McCarthy

💻
Thomas
Thomas

💻
Anurag Agarwal
Anurag Agarwal

💻
Markus Moser
Markus Moser

🎨 💻 🤔
Sabiq Ihab
Sabiq Ihab

💻
Amit Dixit
Amit Dixit

💻
Piyush Kailash Chaudhari
Piyush Kailash Chaudhari

💻
joshzambales
joshzambales

💻
Kamil Pietruszka
Kamil Pietruszka

💻
Zafar Khaydarov
Zafar Khaydarov

💻 📖
Paul Campbell
Paul Campbell

💻
Argyro Sioziou
Argyro Sioziou

💻
TylerMcConville
TylerMcConville

💻
saksham93
saksham93

💻
nikhilbarar
nikhilbarar

💻
Colin But
Colin But

💻
Ruslan
Ruslan

💻
Juho Kang
Juho Kang

💻
Dheeraj Mummareddy
Dheeraj Mummareddy

💻
Bernardo Sulzbach
Bernardo Sulzbach

💻
Aleksandar Dudukovic
Aleksandar Dudukovic

💻
Yusuf Aytaş
Yusuf Aytaş

💻
Mihály Kuprivecz
Mihály Kuprivecz

💻
Stanislav Kapinus
Stanislav Kapinus

💻
GVSharma
GVSharma

💻
Srđan Paunović
Srđan Paunović

💻
Petros G. Sideris
Petros G. Sideris

💻
Pramod Gupta
Pramod Gupta

👀
Amarnath Chandana
Amarnath Chandana

💻
Anurag870
Anurag870

💻 📖
Wes Gilleland
Wes Gilleland

💻
Harshraj Thakor
Harshraj Thakor

💻
Martin Vandenbussche
Martin Vandenbussche

💻
Alexandru Somai
Alexandru Somai

💻
Artur Mogozov
Artur Mogozov

💻
anthony
anthony

💻
Christian Cygnus
Christian Cygnus

💻
Dima Gubin
Dima Gubin

💻
Joshua Jimenez
Joshua Jimenez

💻
Kai Winter
Kai Winter

💻
lbroman
lbroman

💻
Przemek
Przemek

💻
Prafful Agarwal
Prafful Agarwal

🖋
Sanket Panhale
Sanket Panhale

🖋
staillebois
staillebois

💻
Krisztián Nagy
Krisztián Nagy

💻
Alexander Ivanov
Alexander Ivanov

💻
Yosfik Alqadri
Yosfik Alqadri

💻
Agustí Becerra Milà
Agustí Becerra Milà

💻
Juan Manuel Suárez
Juan Manuel Suárez

💻
Luigi Cortese
Luigi Cortese

💻
Katarzyna Rzepecka
Katarzyna Rzepecka

💻
adamski.pro
adamski.pro

💻
Shengli Bai
Shengli Bai

💻
Boris
Boris

💻
Dmitry Avershin
Dmitry Avershin

💻
靳阳
靳阳

💻
hoangnam2261
hoangnam2261

💻
Arpit Jain
Arpit Jain

💻
Jón Ingi Sveinbjörnsson
Jón Ingi Sveinbjörnsson

💻
Kirill Vlasov
Kirill Vlasov

💻
Mitchell Irvin
Mitchell Irvin

💻
Ranjeet
Ranjeet

💻
PhoenixYip
PhoenixYip

💻
M Saif Asif
M Saif Asif

💻
kanwarpreet25
kanwarpreet25

💻
Leon Mak
Leon Mak

💻
Per Wramdemark
Per Wramdemark

💻
Evan Sia Wai Suan
Evan Sia Wai Suan

💻
AnaghaSasikumar
AnaghaSasikumar

💻
Christoffer Hamberg
Christoffer Hamberg

💻
Dominik Gruntz
Dominik Gruntz

💻
Hannes
Hannes

💻
Leo Gutiérrez Ramírez
Leo Gutiérrez Ramírez

💻
Zhang WH
Zhang WH

💻
Christopher O'Connell
Christopher O'Connell

💻
George Mavroeidis
George Mavroeidis

💻
Hemant Bothra
Hemant Bothra

💻 🎨
Kevin Peters
Kevin Peters

💻
George Aristy
George Aristy

💻
Mahendran Mookkiah
Mahendran Mookkiah

💻
Azureyjt
Azureyjt

💻
gans
gans

💻
Matt
Matt

🖋
Gopinath Langote
Gopinath Langote

💻
Hoswey
Hoswey

💻
Amit Pandey
Amit Pandey

💻
gwildor28
gwildor28

🖋
田浩
田浩

🖋
Stamatis Pitsios
Stamatis Pitsios

💻
qza
qza

💻
Rodolfo Forte
Rodolfo Forte

🖋
Ankur Kaushal
Ankur Kaushal

💻
Ovidijus Okinskas
Ovidijus Okinskas

💻
Robert Kasperczyk
Robert Kasperczyk

💻
Tapio Rautonen
Tapio Rautonen

💻
Yuri Orlov
Yuri Orlov

💻
Varun Upadhyay
Varun Upadhyay

💻
Aditya Pal
Aditya Pal

💻
grzesiekkedzior
grzesiekkedzior

💻 👀
Sivasubramani M
Sivasubramani M

💻
Sami Airaksinen
Sami Airaksinen

💻
Janne Sinivirta
Janne Sinivirta

💻
Boris-Chengbiao Zhou
Boris-Chengbiao Zhou

🖋
Jacob Hein
Jacob Hein

🖋
Richard Jones
Richard Jones

🖋
Rachel M. Carmena
Rachel M. Carmena

🖋
Zaerald Denze Lungos
Zaerald Denze Lungos

🖋
Lars Kappert
Lars Kappert

🖋
Mike Liu
Mike Liu

🌍
Matt Dolan
Matt Dolan

💻 👀
Manan
Manan

👀
Nishant Arora
Nishant Arora

💻
Peeyush
Peeyush

💻
Rakesh
Rakesh

💻 👀
Wei Seng
Wei Seng

💻
Ashish Trivedi
Ashish Trivedi

💻
洪月阳
洪月阳

💻
xdvrx1
xdvrx1

👀 🤔
Bethan Palmer
Bethan Palmer

💻
Toxic Dreamz
Toxic Dreamz

💻
Edy Cu Tjong
Edy Cu Tjong

📖
Michał Krzywański
Michał Krzywański

💻
Stefan Birkner
Stefan Birkner

💻
Fedor Skvorcov
Fedor Skvorcov

💻
samilAyoub
samilAyoub

💻
Vladislav Golubinov
Vladislav Golubinov

💻
Swaraj
Swaraj

💻
Christoph Flick
Christoph Flick

📖
Ascênio
Ascênio

👀
Domenico Sibilio
Domenico Sibilio

📖
Akash Chandwani
Akash Chandwani

👀
Pavlo Manannikov
Pavlo Manannikov

💻
Eiman
Eiman

💻
Rocky
Rocky

📖
Ibrahim ali abdelghany
Ibrahim ali abdelghany

👀
Girish Kulkarni
Girish Kulkarni

📖
Omar Karazoun
Omar Karazoun

💻
Jeff Evans
Jeff Evans

💻
Vivek Singh
Vivek Singh

💻
siavash
siavash

💻
ruchpeanuts
ruchpeanuts

📖
warp125
warp125

🌍
KHADIR Tayeb
KHADIR Tayeb

🌍
ignite1771
ignite1771

💻
Halil Demir
Halil Demir

🌍
Rohit Singh
Rohit Singh

💻
byoungju94
byoungju94

💻
Moustafa Farhat
Moustafa Farhat

🌍
Martel Richard
Martel Richard

💻
va1m
va1m

💻
Noam Greenshtain
Noam Greenshtain

💻
yonghong Xu
yonghong Xu

📖
jinishavora
jinishavora

👀 💻
Elvys Soares
Elvys Soares

💻
zWeBrain
zWeBrain

💻
余林颖
余林颖

🌍
Alain
Alain

🌍
VR
VR

📖
JackieNim
JackieNim

💻
EdisonE3
EdisonE3

💻
Tao
Tao

💻
Juan Manuel Abate
Juan Manuel Abate

🌍
Xenilo137
Xenilo137

💻
Samuel Souza
Samuel Souza

💻 📖
Marlo Henrique
Marlo Henrique

🌍
AndriyPyzh
AndriyPyzh

💻
karthikbhat13
karthikbhat13

💻
Morteza Adigozalpour
Morteza Adigozalpour

💻
Nagaraj Tantri
Nagaraj Tantri

💻
Francesco Scuccimarri
Francesco Scuccimarri

💻
Conny Hansson
Conny Hansson

📖
Muklas Rahmanto
Muklas Rahmanto

🌍
Vadim
Vadim

🌍
Simran Keshri
Simran Keshri

💻
JCarlos
JCarlos

🌍
Ali Ghasemi
Ali Ghasemi

💻
Carl Dea
Carl Dea

💻
Mozartus
Mozartus

🌍
Manvi Goel
Manvi Goel

📖
Anum Amin
Anum Amin

📖
Reo Uehara
Reo Uehara

🌍
Fiordy
Fiordy

📖
Harshal
Harshal

💻
Abhinav Vashisth
Abhinav Vashisth

📖
Kevin
Kevin

👀 💻
Shrirang
Shrirang

👀 💻
interactwithankush
interactwithankush

💻
CharlieYu
CharlieYu

💻
Leisterbecker
Leisterbecker

💻
DragonDreamer
DragonDreamer

💻
ShivanshCharak
ShivanshCharak

💻
HattoriHenzo
HattoriHenzo

💻
Arnab Sen
Arnab Sen

💻
MohanaRao SV
MohanaRao SV

💻
Yonatan Karp-Rudin
Yonatan Karp-Rudin

💻 👀
Oliani
Oliani

💻
Renjie LIU
Renjie LIU

💻
perfect guy
perfect guy

📖
xyllq999
xyllq999

💻
Mohamed Bilal
Mohamed Bilal

📖
Karshil sheth
Karshil sheth

💻
kongleong86
kongleong86

💻
Aitor Fidalgo Sánchez
Aitor Fidalgo Sánchez

🌍 📖 👀
Victor He
Victor He

💻
Minh Nguyen
Minh Nguyen

🌍 📖
Victor He
Victor He

📖
yiichan
yiichan

📖
Pan Sem
Pan Sem

📖
zhoumengyks
zhoumengyks

💻
you
you

🌍
Thanks
Thanks

🌍
LazyProgrammer
LazyProgrammer

📖
Mohammed Faizan Ahmed
Mohammed Faizan Ahmed

📖
Bruno Fernandes
Bruno Fernandes

💻
SammanPali
SammanPali

📖
Qixiang Chen
Qixiang Chen

📖
Shourya Manekar
Shourya Manekar

🌍
Alan
Alan

🌍
JanFidor
JanFidor

💻 📖
Anton Yakutovich
Anton Yakutovich

💻
steph88ss
steph88ss

📖
Yujan Ranjitkar
Yujan Ranjitkar

🌍
yusha-g
yusha-g

🌍
Robert Volkmann
Robert Volkmann

💻 👀
Bipin Kumar Chaurasia
Bipin Kumar Chaurasia

📖
KyleSong30
KyleSong30

📖
u7281975
u7281975

📖
harshalkhachane
harshalkhachane

💻
Tejas Singh
Tejas Singh

📖 🌍
Sudarsan Balaji
Sudarsan Balaji

💻
Vaibhav Agrawal
Vaibhav Agrawal

📖
u7275858
u7275858

💻
prasad-333
prasad-333

📖
JurenXu
JurenXu

💻
murphShaw
murphShaw

📖
XianWu99
XianWu99

📖
JoshuaSinglaANU
JoshuaSinglaANU

💻
Ricardo Ramos
Ricardo Ramos

🌍
Farid Zouheir
Farid Zouheir

🌍
Vinícius A. B.
Vinícius A. B.

🌍
Stefanel Stan
Stefanel Stan

💻
Prince bhati
Prince bhati

🌍
WuLang
WuLang

📖
Hugo Kat
Hugo Kat

💻
Shivanagouda Agasimani
Shivanagouda Agasimani

💻
Aparna
Aparna

💻
Girolamo Giordano
Girolamo Giordano

🌍
Chak-C
Chak-C

💻
Nakul Nambiar
Nakul Nambiar

💻
KarmaTashiCat
KarmaTashiCat

🌍
marikattt
marikattt

💻
Hashvardhan Parmar
Hashvardhan Parmar

🌍
YongHwan
YongHwan

📖 🌍
Shogo Hida
Shogo Hida

🌍
Eugene
Eugene

💻
Piyush
Piyush

📖
Rahul Raj
Rahul Raj

💻
Bharath Kalyan S
Bharath Kalyan S

💻
Saiteja Reddy
Saiteja Reddy

🌍
Enrique Clerici
Enrique Clerici

🌍
Ramil Sayetov
Ramil Sayetov

🌍
东方未白
东方未白

💻
Fredrik Sejr
Fredrik Sejr

🌍
akshatarora0013
akshatarora0013

💻
Mughees Qasim
Mughees Qasim

💻
behappyleee
behappyleee

🌍
Ayush Thakur
Ayush Thakur

🌍
Anthony Bosch
Anthony Bosch

💻
trananso
trananso

📖
Giammaria Biffi
Giammaria Biffi

🌍
Saiful Haque
Saiful Haque

💻
JabezBrew
JabezBrew

💻
konstantin-goldman
konstantin-goldman

📖
Tien Nguyen Minh
Tien Nguyen Minh

💻 🌍
Vladimir
Vladimir

🌍
Surjendu
Surjendu

🌍 💻
bakazhou
bakazhou

💻
Owen Leung
Owen Leung

💻
Stavros Barousis
Stavros Barousis

📖
Syyed Ibrahim Abdullah
Syyed Ibrahim Abdullah

🌍
JiaDi Zhang
JiaDi Zhang

🌍
Sanchit Bansal
Sanchit Bansal

📖
Md Saiful Islam
Md Saiful Islam

📖
Antonio Addeo
Antonio Addeo

📖 💻
Allagadda Sai Upendranath
Allagadda Sai Upendranath

📖
Matheus Braga
Matheus Braga

🌍 📖
Appari Satya Barghav
Appari Satya Barghav

📖
Marcel Ribeiro-Dantas
Marcel Ribeiro-Dantas

📖
Muhammad Hanif Amrullah
Muhammad Hanif Amrullah

🌍
JackH408
JackH408

📖
Shubham
Shubham

🌍
Nishant Jain
Nishant Jain

📖
Rhitam Chaudhury
Rhitam Chaudhury

📖
JerryZhao275
JerryZhao275

📖
Leonardo Lisanti
Leonardo Lisanti

🌍
Yennifer Herrera
Yennifer Herrera

🌍 👀
jnniu-n
jnniu-n

🌍 📖
Miguel Angel Perez Garcia
Miguel Angel Perez Garcia

👀 🌍
Suwan Sankaja
Suwan Sankaja

🌍
alok
alok

📖
Daniel Lisboa
Daniel Lisboa

🌍
Sam Powell
Sam Powell

📖
João Fernandes
João Fernandes

🌍
Hong Geon-ui
Hong Geon-ui

🌍
Doksanbir
Doksanbir

💻 📖 👀
Chant3ll3
Chant3ll3

📖 🌍
YongHwan Kwon
YongHwan Kwon

💻
Jakub Klimek
Jakub Klimek

💻
believe
believe

🌍
egg0102030405
egg0102030405

🌍 📖
Ved Asole
Ved Asole

💻
NewMorning
NewMorning

🌍
资深老萌新
资深老萌新

🌍
Seunghwan Jeon
Seunghwan Jeon

🌍
sugavanesh
sugavanesh

💻
FinnS-F
FinnS-F

💻
jerryyummy
jerryyummy

🌍
Manoj Chowdary
Manoj Chowdary

💻
Aditya
Aditya

📖 💻
nooynayr
nooynayr

📖
CYBERCRUX2
CYBERCRUX2

📖
Luis Mateo Hincapié Martinez
Luis Mateo Hincapié Martinez

🌍 👀
guqing
guqing

💻
Sashir Estela
Sashir Estela

💻
omahs
omahs

📖
leif e.
leif e.

💻
Jun Kang
Jun Kang

💻
Kishalay Pandey
Kishalay Pandey

💻
drishtii7
drishtii7

💻
David Medina Orozco
David Medina Orozco

🌍 👀
Roman Leontev
Roman Leontev

💻
Riley
Riley

💻
k1w1dev
k1w1dev

💻
dev-yugantar
dev-yugantar

💻
Adelya
Adelya

💻
gatlanagaprasanna
gatlanagaprasanna

📖
Avinash Shukla
Avinash Shukla

💻
Mayank Choudhary
Mayank Choudhary

💻
romannimets
romannimets

💻
Joel
Joel

💻
Walyson Moises
Walyson Moises

💻

java-design-patterns's People

Contributors

4lexis avatar allcontributors[bot] avatar anuragagarwal561994 avatar argyro-sioziou avatar ashishtrivedi16 avatar colinbut avatar crossy147 avatar dependabot-preview[bot] avatar dependabot[bot] avatar dheeraj-mummareddy avatar fluxw42 avatar iluwatar avatar inbravo avatar isabiq avatar joshzambales avatar juhokang avatar kemitix avatar markusmo3 avatar mikulucky avatar nikhilbarar avatar npathai avatar ohbus avatar piyushchaudhari04 avatar robertvolkmann avatar ruslanpa avatar saksham93 avatar thomasoss avatar tylermcconville avatar uglywarthog avatar zafarella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-design-patterns's Issues

Practical explanations

First, I'd like to thank you for providing the examples, really great job! However, I'd like more practical explanations since currently they are rather theoretical and hard to understand, don't you think?

For example the Builder pattern, I've read the explanation and honestly do not know when to use in my daily work. Wouldn't it be better just to write that you use it if you have few required and many optional construction parameters?

DAO Design Pattern

Hi @iluwatar ,

First of all, thank you for this comprehensive repo! I haven't seen the dao design pattern among the rest. So, I am just wondering whether it is actually part of the design solutions or not.

HeroBuilder NullPointerException

I was reading the code and then I wondered why was used the NullPointerException in that case, won't be more readable throw a custom exception? I mean create something like BuilderException and then this can be treated in the caller method ...
*Line 97,98 from HeroBuilder.java for reference

Data Mapper Pattern

Hi, I'm a new user to github and I would like to help to this project. I've been researching about a few patterns and the work you've done and I think it's so cool.

In my college I've developed an application which comunicates with a MySQL Database and I had to build a pattern to make that communication work. I'm talking about the Abstract Mapper.

I have an example here: https://github.com/jesusvazquez/java_examples/tree/master/AdvancedDatabaseSystems/src/modelo/DBMapper

I'm wondering if it would be a good idea to add this pattern to your project.

Best Regards.

Binding Properties pattern

Description

The Binding Properties design pattern is used to synchronize state between different components or objects in a system, ensuring that changes in one part are automatically reflected in another. This pattern is particularly useful in scenarios involving UI components and their underlying data models, where maintaining consistent state across various elements is crucial.

Main Elements of Binding Properties Pattern:

  1. Observable Property: A property whose changes can be observed by other objects.
  2. Observer: An object that subscribes to changes in the observable property and updates itself accordingly.
  3. Binding Mechanism: The infrastructure that connects the observable properties with their observers, facilitating the automatic update process.
  4. Two-Way Binding: An optional feature where changes in either the observable property or the observer can propagate in both directions.

References

  1. Java Design Patterns Project Contribution Guidelines
  2. Binding Properties Design Pattern - Wikipedia
  3. Binding Properties in WikiWikiWeb

Acceptance Criteria

  1. Implementation of Observable Property: Create a class representing an observable property that allows observers to register and unregister, and notifies them of changes.
  2. Observer Interface: Define an interface for observers that requires an update method, which will be called when the observable property changes.
  3. Binding Mechanism: Develop the infrastructure to link observable properties with their observers, supporting at least one-way binding. Optionally, implement two-way binding functionality.

Please ensure that the implementation adheres to the project contribution guidelines and includes appropriate documentation and test cases.

Join pattern

Description:
The Join design pattern allows multiple concurrent processes or threads to be synchronized such that they all must complete before any subsequent tasks can proceed. This pattern is particularly useful in scenarios where tasks can be executed in parallel but the subsequent tasks must wait for the completion of these parallel tasks.

Main Elements of Join Pattern:

  1. Task Execution: Multiple tasks are executed concurrently.
  2. Synchronization Point: A join point where all tasks must converge and synchronize.
  3. Completion Handling: After all tasks reach the join point, subsequent tasks can proceed.

References:

Acceptance Criteria:

  1. Implement a JoinPattern class demonstrating the synchronization of multiple threads using the join pattern.
  2. Include a comprehensive unit test that validates the correct synchronization and execution order of threads.
  3. Ensure the implementation follows the project contribution guidelines as outlined in the wiki.

Facet pattern

Description:

The Facet design pattern is used to represent different aspects or views of an object, allowing an object to expose multiple interfaces that reflect different facets of its functionality. This pattern is useful in situations where an object needs to be interacted with in various ways depending on the context or role.

Main Elements of the Facet Design Pattern:

  1. Core Object: The primary object that contains the core data and functionality.
  2. Facet Interfaces: Interfaces that represent different aspects or views of the core object. Each interface provides a specific subset of the core object's functionality.
  3. Facet Implementations: Concrete classes that implement the facet interfaces, often acting as wrappers around the core object to provide the necessary views or functionalities.

References:

Acceptance Criteria:

  1. A core object should be identified or created that contains the primary data and functionality.
  2. Multiple facet interfaces should be defined, each representing a different view or aspect of the core object.
  3. Concrete classes implementing the facet interfaces should be created, providing the necessary views or functionalities by interacting with the core object.
  4. Unit tests should be written to ensure that the facet interfaces and their implementations correctly interact with the core object and provide the expected functionalities.

Scheduler pattern

Description

The Scheduler design pattern is a behavioral pattern used to manage the execution of tasks. This pattern is particularly useful in scenarios where tasks need to be executed at specific intervals or under specific conditions. The Scheduler pattern typically involves a scheduler component that manages task execution, a task component that defines the executable units of work, and a trigger or condition that initiates task execution.

Main elements of the Scheduler pattern:

  1. Scheduler: Manages the execution of tasks, determining when and how often they should run.
  2. Task: Represents the work to be performed, encapsulating the logic for execution.
  3. Trigger/Condition: Specifies the criteria or schedule for task execution, such as time intervals or specific events.
  4. Execution Context: Provides the environment in which tasks are executed, handling necessary resources and states.

References

Acceptance Criteria

  1. Implement the Scheduler component to manage and execute tasks based on defined triggers or conditions.
  2. Define and implement a Task interface that encapsulates the logic for various tasks.
  3. Create examples demonstrating the usage of the Scheduler pattern with different types of triggers/conditions and tasks.

Intercepting Filter example needs some improvement

  • FilterChain executes the filters sequentially using an array. This should be changed so that the filters form a chain and call each other instead. Like in Chain of Responsibility.
  • At the same time the feedback mechanism from the filters should be improved. This should be implemented with Collecting Parameter idiom. It should be possible to return multiple errors from the filter chain. The current implementation can handle only one.
  • The data passed to the filters should be transformed into value object from string array. This way we can get rid of magic numbers (array index) in filters.

New patterns

Is it possible that we add web application and database patterns here as well? By web application patterns, I mean

  1. Single Thread pattern
  2. Synchronization pattern in MVC
  3. Double checked locking
  4. Service locator
  5. Facade
    ..... (any more that we can think of)

and the database patterns I had the data access (DAO) pattern in mind.

Idea.

Add the "real" project(or link to good project) where the most of patterns will be represented.And fully documented.To see how they used in real life.For example text editor.Or something else.

not a issue,just want to know

hey,I see a file ends with ucls in some package,I open it and find it is an xml format file
and my question is what kind of soft you draw it
Thanks!

Active Record pattern

Description

The Active Record design pattern is a common architectural pattern used to manage database records. It simplifies data access by encapsulating the database logic within a model class. Each instance of the model corresponds to a row in the database, and the model class includes methods for CRUD (Create, Read, Update, Delete) operations.

Main Elements of Active Record Pattern:

  1. Model Class: Represents a table in the database. Each instance represents a single row.
  2. CRUD Operations: Methods for Create, Read, Update, and Delete operations are defined within the model.
  3. Database Connection: The model class manages the database connection.
  4. Simple Queries: Basic querying capabilities are encapsulated within the model.

References

Acceptance Criteria

  1. A new model class should be created, representing a database table.
  2. The model class should include methods for basic CRUD operations.
  3. The implementation should adhere to the project’s contribution guidelines and include relevant documentation and unit tests.

Better View/Navigation ?

Heya there,
first of all, i love this resource and use it quite often. the only thing slightly annoying is the layout. Would be really awesome to view this resource in bootstrap with categories or something like that.

If something like that is done "hardcoded" the project will probably loose on contributions, so a converter of sorts should be used.

One last point, i found this Site that looks pretty good, but i dont know if it would be suitable. I also have no idea if it even works, because here everything is one single markdown document, while those at the site are multiple.
http://phpmyadmin.readthedocs.org/en/QA_4_4/
(topic is not important)

Just an idea C:

~Markus

Blackboard architectural pattern

Description:

Implement the Blackboard design pattern in the project. The Blackboard pattern is an architectural pattern used in situations where multiple subsystems need to collaborate to solve a problem that is beyond the individual capabilities or knowledge of each subsystem. The main elements of the Blackboard pattern include:

  • Blackboard: A shared global memory structure that holds the data or state of the solution space. All subsystems read from and write to the blackboard.
  • Knowledge Sources: Independent subsystems or modules that have specialized knowledge and can operate on the data in the blackboard. They can contribute partial solutions or refine existing data.
  • Control Component: Manages the flow of control among the knowledge sources. It determines which knowledge source will get access to the blackboard at any given time based on certain criteria or heuristics.

References:

Acceptance Criteria:

  1. A blackboard component that allows multiple knowledge sources to read and write data.
  2. At least three independent knowledge sources that interact with the blackboard to contribute to or refine the solution.
  3. A control component that manages the interaction between the knowledge sources and ensures orderly access to the blackboard.

For more details on contributing to this project, please refer to our contribution guidelines.

Bug introduced by #11

@llitfkitfk You made ALL the diagrams link to files from your FORK. The BASE readme is pointing to files from a FORK.

commit hash is 97431a62af9881fa046b69b690e72d4fb4777209

please help me , thanks !

Hello, may I ask you what software tool to draw a class diagram?

I want to get it.

Can you send it to my email ? Or tell me what its name . Thank you very much!

My email : [email protected]

Proactor pattern

Description:
The Proactor design pattern is an asynchronous programming pattern used to efficiently handle multiple concurrent operations. In this pattern, the application initiates asynchronous operations and a separate handler (the Proactor) deals with the completion of these operations. The Proactor pattern is useful in scenarios where the system needs to handle a high number of I/O operations, such as in network servers and high-performance computing applications.

Main Elements of Proactor Pattern:

  1. Initiator: The component that initiates asynchronous operations.
  2. Asynchronous Operation: The operations that are performed asynchronously, often related to I/O tasks.
  3. Completion Handler: A callback or handler that is invoked when the asynchronous operation is complete.
  4. Proactor: The dispatcher that manages the completion of asynchronous operations and invokes the appropriate handlers.
  5. Operation Result: The data or result obtained after the completion of the asynchronous operation.

References:

  1. Proactor Design Pattern - Wikipedia
  2. Asynchronous I/O - Proactor Pattern

Acceptance Criteria:

  1. The implementation should include a clear separation of the main elements: Initiator, Asynchronous Operation, Completion Handler, and Proactor.
  2. A working example demonstrating the Proactor pattern in a real-world scenario, such as a network server handling multiple simultaneous connections.
  3. Comprehensive unit tests to verify the correct behavior of each component in the pattern, ensuring robustness and reliability.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.