- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Usage patterns for Scala traits
Wed, 2010-02-24, 20:55
Hi everybody,
I am currently working on a research project in the context of my
Master's at the ETH Zürich. The project's (long-term) goal is to develop
a contract language (pre-, postconditions, invariants, the usual stuff)
to be able to verify certain aspects of Scala traits.
For starters, I'd like to exemplify typical patterns (or use-cases) of
Scala traits. So far I have the "stackable modifications" pattern, the
"interface enrichment" pattern (both taken from the "Programming in
Scala" book [1]) and the "functionality extension" "pattern" as
exemplified in [2] (p. 14, German document).
I already went through a lot of tutorials and small projects and I am
going to have a closer look at the Scala Compiler and at Lift.
However, I would be grateful for any hint where to look for typical
and/or interesting uses of traits. Of course, complete examples are more
than welcome :-)
Best regards
Malte
P.S. I cross-posted this mail to the Lift, Scala and Scala-Users mailing
list. I hope nobody takes offense at this.
[1] http://www.artima.com/shop/programming_in_scala
[2] pp.info.uni-karlsruhe.de/lehre/SS2009/foo/Kapitel14.pdf
Wed, 2010-02-24, 21:57
#2
Re: Usage patterns for Scala traits
This might be more basic then what you are looking for, but I found Jonas Boner's tutorial for Akka to be the tipping point on how to use traits to allow different configurations for a class. This was an aspect that I didn't properly grasp before. It can be found at:
http://jonasboner.com/2010/01/04/introducing-akka.html
Derek
On Wed, Feb 24, 2010 at 12:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
--
Derek
On Wed, Feb 24, 2010 at 12:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
Hi everybody,
I am currently working on a research project in the context of my
Master's at the ETH Zürich. The project's (long-term) goal is to develop
a contract language (pre-, postconditions, invariants, the usual stuff)
to be able to verify certain aspects of Scala traits.
For starters, I'd like to exemplify typical patterns (or use-cases) of
Scala traits. So far I have the "stackable modifications" pattern, the
"interface enrichment" pattern (both taken from the "Programming in
Scala" book [1]) and the "functionality extension" "pattern" as
exemplified in [2] (p. 14, German document).
I already went through a lot of tutorials and small projects and I am
going to have a closer look at the Scala Compiler and at Lift.
However, I would be grateful for any hint where to look for typical
and/or interesting uses of traits. Of course, complete examples are more
than welcome :-)
Best regards
Malte
P.S. I cross-posted this mail to the Lift, Scala and Scala-Users mailing
list. I hope nobody takes offense at this.
[1] http://www.artima.com/shop/programming_in_scala
[2] pp.info.uni-karlsruhe.de/lehre/SS2009/foo/Kapitel14.pdf
--
Derek
Wed, 2010-02-24, 23:17
#3
Re: Usage patterns for Scala traits
I tried to collect a few myself back in the day: http://suereth.blogspot.com/2009/02/how-should-traits-in-scala-be-used.html
- Josh
On Wed, Feb 24, 2010 at 2:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
- Josh
On Wed, Feb 24, 2010 at 2:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
Hi everybody,
I am currently working on a research project in the context of my
Master's at the ETH Zürich. The project's (long-term) goal is to develop
a contract language (pre-, postconditions, invariants, the usual stuff)
to be able to verify certain aspects of Scala traits.
For starters, I'd like to exemplify typical patterns (or use-cases) of
Scala traits. So far I have the "stackable modifications" pattern, the
"interface enrichment" pattern (both taken from the "Programming in
Scala" book [1]) and the "functionality extension" "pattern" as
exemplified in [2] (p. 14, German document).
I already went through a lot of tutorials and small projects and I am
going to have a closer look at the Scala Compiler and at Lift.
However, I would be grateful for any hint where to look for typical
and/or interesting uses of traits. Of course, complete examples are more
than welcome :-)
Best regards
Malte
P.S. I cross-posted this mail to the Lift, Scala and Scala-Users mailing
list. I hope nobody takes offense at this.
[1] http://www.artima.com/shop/programming_in_scala
[2] pp.info.uni-karlsruhe.de/lehre/SS2009/foo/Kapitel14.pdf
Wed, 2010-02-24, 23:17
#4
Re: Usage patterns for Scala traits
I tried to collect a few myself back in the day: http://suereth.blogspot.com/2009/02/how-should-traits-in-scala-be-used.html
- Josh
On Wed, Feb 24, 2010 at 2:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
- Josh
On Wed, Feb 24, 2010 at 2:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
Hi everybody,
I am currently working on a research project in the context of my
Master's at the ETH Zürich. The project's (long-term) goal is to develop
a contract language (pre-, postconditions, invariants, the usual stuff)
to be able to verify certain aspects of Scala traits.
For starters, I'd like to exemplify typical patterns (or use-cases) of
Scala traits. So far I have the "stackable modifications" pattern, the
"interface enrichment" pattern (both taken from the "Programming in
Scala" book [1]) and the "functionality extension" "pattern" as
exemplified in [2] (p. 14, German document).
I already went through a lot of tutorials and small projects and I am
going to have a closer look at the Scala Compiler and at Lift.
However, I would be grateful for any hint where to look for typical
and/or interesting uses of traits. Of course, complete examples are more
than welcome :-)
Best regards
Malte
P.S. I cross-posted this mail to the Lift, Scala and Scala-Users mailing
list. I hope nobody takes offense at this.
[1] http://www.artima.com/shop/programming_in_scala
[2] pp.info.uni-karlsruhe.de/lehre/SS2009/foo/Kapitel14.pdf
On Wed, Feb 24, 2010 at 12:54 PM, Malte Schwerhoff <mhslists@schwerhoff.de> wrote:
--
Derek