•  


GitHub - josephguan/scala-design-patterns: Design patterns implemented in Scala.
Skip to content

josephguan/scala-design-patterns

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design patterns implemented in Scala

Inspired by Design patterns implemented in Java

Introduction

Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. The classical design patterns are the 23 design patterns by GoF.

This project implements dozens of design patterns in Scala. The Scala language has several advanced features which make the implementations are different from other programming languages.

Design patterns are categorized into:

  1. Creational
  2. Structural
  3. Behavioral
  4. Other
  5. Persistence

For each design pattern, it tags:

  1. scala features indicates if the implementation uses scala language-specific features.
  2. functional indicates if the design pattern can be implemented in functional-programming style.
  3. Gang of four indicates if the design pattern is one of the classical 23 design patterns by GoF

Creational

Name scala features functional Gang of four
abstract factory no no yes
builder no no yes
cake yes (trait mix-in) no no
factory kit no yes no
factory method no no yes
prototype no no yes
simple factory yes (companion object) no no
singleton yes (object) no yes
value object yes (case class) no no

Structural

Name scala features functional Gang of four
adapter yes (implicit class) no yes
bridge no no yes
composite no no yes
decorator yes (stackable trait) no yes
facade no no yes
flyweight no no yes
magnet yes (implicit conversion) no no
proxy no no yes
type classes yes (impilict parameter) no no

Behavioral

Name scala features functional Gang of four
chain of responsibility yes (partial function) yes yes
command no yes yes
loan yes (structural type) yes no
mediator no no yes
memento no no yes
observer no no yes
state no no yes
strategy no yes yes
template method no no yes
visitor no yes yes

Other

Name scala features functional Gang of four
selfless trait yes (companion trait) no no
monad no yes no

Persistence

Name scala features functional Gang of four
data access object no no no
repository no no no

Getting Started

Run sbt assembly to compile, run tests and package all sub-projects.

If you want to operate specific sub-project, use project command in sbt shell to switch sub-project:

>
 projects          // list all sub-projects
>
 project builder   // switch to 
'
builder
'
 sub-project
>
 project all       // switch to 
'
all
'
 project which including all sub-projects

License

This project is licensed under the terms of the Apache 2.0 license.

Releases

No releases published

Packages

No packages published

Languages

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본