14 Dec 2010Dependency Injection in Scala: Extending the Cake Pattern Continuing the mini-series on Dependency Injection (see my previous blogs: problems with DI, assisted inject for CDI and improving assisted inject), I took a look at how DI is handled in Scala. There are several approaches, one of the most interesting being the Cake Pattern. It is a DI solution that uses only native language feat
Scala(スカラ、SKAH-lah[3])はオブジェクト指向言語と関数型言語の特徴を統合したマルチパラダイムのプログラミング言語である。名前の「Scala」は英語の「scalable language」に由来するものである。 主にJavaプラットフォーム(Java仮想マシン)上で動作し、既存のJavaのプログラムと容易に連携させることができる。 対応プラットフォーム Scala - Javaプラットフォーム Scala.js[4] - Scala から JavaScript へとトランスパイルする。 Scala Native[5] - LLVM を使用し、マシンネイティブの実行ファイルを出力 また、過去には下記のプラットフォームもサポートしていたが、現在は開発が中断している。 .NET Framework[6] Java Platform, Micro Edition CLDC Scal
Scala (/ˈskɑːlɑː/ SKAH-lah)[7][8] is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise,[9] many of Scala's design decisions are intended to address criticisms of Java.[6] Scala source code can be compiled to Java bytecode and run on a Java virtual machine (JVM). Scala can also
A Scalable language Scala is an acronym for “Scalable Language”. This means that Scala grows with you. You can play with it by typing one-line expressions and observing the results. But you can also rely on it for large mission critical systems, as many companies, including Twitter, LinkedIn, or Intel do. To some, Scala feels like a scripting language. Its syntax is concise and low ceremony; its t
2011-04-23 Akka の作者として益々注目を集めている Jonas Bonér が 2008年に書いた “Real-World Scala: Dependency Injection (DI)” を翻訳しました。翻訳の公開は本人より許諾済みです。翻訳の間違い等があれば遠慮なくご指摘ください。 2008年10月6日 Jonas Bonér 著 2011年4月22日 eed3si9n 訳 さて、実戦での Scala シリーズ第二弾の今回は、Scala を用いた Depenency Injection (DI) の実装をみていきたい。Scala は、備わっている言語機構だけを用いても何通りかの DI を実現できる非常に豊かでディープな言語だが、必要に応じて既存の Java DI フレームワークを使うこともできる。 Triental では、一つの戦略に落ち着くまで三つの異なる方法を試した
継続モナドを使ってPlay FrameworkのActionを作るという話をします。 Play FrameworkはScalaのWebアプリケーションフレームワークであり、Actionはそのコントローラー部分になります。 この記事を読むにあたって継続モナドの知識は前提としませんが、 ある程度のモナドの知識(Scalaのfor構文の使い方、ScalaのモナドがflatMapメソッドで合成できることなど) Play Frameworkの使い方(PlayのActionがどのようなものであるかなど) などの知識は前提とし、説明を省略させていただきます。 話の流れとしては以下のようになります。 コントローラーで継続モナドを使いたい動機 継続モナドとは? なぜコントローラーで継続モナドを使うと便利なのか? 継続モナドとFutureを組み合わせることでエラー処理を整理する 継続モナドを使ったAction
val fruits = List("apple", "banana", "avocado", "papaya") val countsToFruits = // count how many 'a' in each fruit fruits.groupBy(fruit => fruit.count(_ == 'a')) for (count, fruits) <- countsToFruits do println(s"with 'a' × $count = $fruits") // prints: with 'a' × 1 = List(apple) // prints: with 'a' × 2 = List(avocado) // prints: with 'a' × 3 = List(banana, papaya)
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く