- JDKがinstall済みであること
- java コマンドに環境変数Pathが通っていること
| 更新: | 2015-10-03 |
|---|---|
| 作者: | @voluntas |
| バージョン: | 1.0.0 |
| URL: | http://voluntas.github.io/ |
概要
この記事は Scala Advent Calendar 2016(Adventar) 10日目の記事です。
今は 12/10 の 625時です。年明けなんて無かった。いいね?
さてさて、sbt の依存jarのダウンロードが遅い、というのは割とよく言われる事であります。
で、この原因の一旦に、sbtが Apache Ivy を使っている、という点があります。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class DomainException(message: String, cause: Throwable) extends RuntimeException(message, cause) | |
| sealed abstract class FooDomainException(message: String, cause: Throwable) extends DomainException(message, cause) | |
| // causeが必ず存在するような例外 | |
| case class BarDomainException(message: String, cause: Throwable) extends FooDomainException(message, cause) | |
| // causeがあったりなかったりするような例外 | |
| case class BazDomainException(message: String, cause: Throwable = null) extends FooDomainException(message, cause) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.twitter.util.Future | |
| import scala.reflect.ClassTag | |
| // generated code | |
| case class FooReqThrift(value: Int) | |
| case class ThriftException(message: String, cause: Throwable) extends RuntimeException(message, cause) | |
| // libs | |
| abstract class RequestAdapter[ReqThrift, ReqDto] { | |
| def adapt(a: ReqThrift): Future[ReqDto] |
パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。
ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。
- crate splitting
- でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
- 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。
2020/5/31追記:
自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。
このドキュメントを完成させるために、今後以下のような更新を予定しています。
- TODO部分を埋める
- 書籍を基にした理論・原則パートと、実装例パートを分割
- 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。
2021/1/22追記:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker build -t spike:latest . | |
| docker run -it spike:latest bash |
OlderNewer