This page is no longer maintained — Please continue to the home page at www.scala-lang.org

About ORMs, pluggability, LINQ, etc.

5 replies
Dmitry Grigoriev
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.

Hello all.

Disclaimer: this is idle talking. While still working on lib.web 0.2
(thin stateless web framework), I sometimes think about... for example,
forum written in scala.

Some forum installations would require thread view counters and/or
message ratings, others would not. These may be and should be
implemented as plugins. Plugins that adjust database structure during
their installation process by adding appropriate columns to messages table.

In Scala, this is naturally expressed via mixins; schematic idea is:

package forum.core.entity
class Message(id: Int, authorId: Int, subj: String, text: String...)

package forum.viewcount.entity
trait Message(viewcount_count: Int)

package forum.ratings.entity
trait Message(ratings_sum: Int, ratings_count: Int)

package customforum.entity
import forum._
class Message
extends core.entity.Message
with viewcount.entity.Message
with ratings.entity.Message

Its all fine (looks fine, at least) but it requires ORM support to be
efficient. I'd much prefer to have LINQ-like stuff to classic heavy ORM.
So here are questions:

1. What can you say about all these draft thoughts above?

2. I've googled "linq for scala" some months ago and found this topic
where some necessary support from compiler was discussed:
http://www.nabble.com/anything-like-LINQ--td14628918.html How is it
going and are there any chances to see LINQ-like project started in the
reasonable future?

3. If someone would start it, please consider use-case I've shown above.

Meredith Gregory
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: About ORMs, pluggability, LINQ, etc.
Dear Dmitry,

Have you looked at scala-query?

Best wishes,

--greg

On Fri, Sep 11, 2009 at 12:09 PM, Dmitry Grigoriev <mail [at] dimgel [dot] ru> wrote:
Hello all.

Disclaimer: this is idle talking. While still working on lib.web 0.2
(thin stateless web framework), I sometimes think about... for example,
forum written in scala.

Some forum installations would require thread view counters and/or
message ratings, others would not. These may be and should be
implemented as plugins. Plugins that adjust database structure during
their installation process by adding appropriate columns to messages table.

In Scala, this is naturally expressed via mixins; schematic idea is:

 package forum.core.entity
 class Message(id: Int, authorId: Int, subj: String, text: String...)

 package forum.viewcount.entity
 trait Message(viewcount_count: Int)

 package forum.ratings.entity
 trait Message(ratings_sum: Int, ratings_count: Int)

 package customforum.entity
 import forum._
 class Message
 extends core.entity.Message
 with viewcount.entity.Message
 with ratings.entity.Message

Its all fine (looks fine, at least) but it requires ORM support to be
efficient. I'd much prefer to have LINQ-like stuff to classic heavy ORM.
So here are questions:

1. What can you say about all these draft thoughts above?

2. I've googled "linq for scala" some months ago and found this topic
where some necessary support from compiler was discussed:
http://www.nabble.com/anything-like-LINQ--td14628918.html How is it
going and are there any chances to see LINQ-like project started in the
reasonable future?

3. If someone would start it, please consider use-case I've shown above.

--
Cheers,
dimgel




--
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com
Dmitry Grigoriev
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.
Re: About ORMs, pluggability, LINQ, etc.

Meredith Gregory wrote:

> Have you looked at scala-query
> ?

No I have not, thanks for link.

anli
Joined: 2008-08-19,
User offline. Last seen 1 day 33 min ago.
Re: Re: About ORMs, pluggability, LINQ, etc.

On Saturday 12 September 2009 00:57:21 Dmitry Grigoriev wrote:
> Meredith Gregory wrote:
> > Have you looked at scala-query
> > ?
>
> No I have not, thanks for link.
>

Also this article can be interesting:

www.cs.uwm.edu/~dspiewak/papers/scalaql.pdf

Article only yet. I didn't understand intentions wrt to the code publising-
date/licensing. Can anybody (authors?) clarify?

Dmitry Grigoriev
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.
Re: About ORMs, pluggability, LINQ, etc.

Andrew Gaydenko wrote:

> Also this article can be interesting:
> www.cs.uwm.edu/~dspiewak/papers/scalaql.pdf

Looked it through briefly, it seems this is a kind of toy yet, not
something that worth using in serious projects:

"Fortunately, Scala is actually powerful enough in and of itself to
implement a form of LINQ even without adding support for expression trees."

"The entire ScalaQL DSL is oriented around a single Scala construct: the
for-comprehension."

This reminds me another funny toy:
http://www.nabble.com/-scala--LINQ-for-scala-td25203779.html
In discussion there guys mention expression trees already in Scala trunk.

Mohamed Bana
Joined: 2008-12-20,
User offline. Last seen 3 years 19 weeks ago.
Re: About ORMs, pluggability, LINQ, etc.
I was told that the language is powerful enough to support this http://msdn.microsoft.com/en-us/magazine/cc163329.aspx.  Perhaps whoever starts it can consider that.

Dmitry Grigoriev wrote:
Hello all.

Disclaimer: this is idle talking. While still working on lib.web 0.2
(thin stateless web framework), I sometimes think about... for example,
forum written in scala.

Some forum installations would require thread view counters and/or
message ratings, others would not. These may be and should be
implemented as plugins. Plugins that adjust database structure during
their installation process by adding appropriate columns to messages table.

In Scala, this is naturally expressed via mixins; schematic idea is:

  package forum.core.entity
  class Message(id: Int, authorId: Int, subj: String, text: String...)

  package forum.viewcount.entity
  trait Message(viewcount_count: Int)

  package forum.ratings.entity
  trait Message(ratings_sum: Int, ratings_count: Int)

  package customforum.entity
  import forum._
  class Message
  extends core.entity.Message
  with viewcount.entity.Message
  with ratings.entity.Message

Its all fine (looks fine, at least) but it requires ORM support to be
efficient. I'd much prefer to have LINQ-like stuff to classic heavy ORM.
So here are questions:

1. What can you say about all these draft thoughts above?

2. I've googled "linq for scala" some months ago and found this topic
where some necessary support from compiler was discussed:
http://www.nabble.com/anything-like-LINQ--td14628918.html How is it
going and are there any chances to see LINQ-like project started in the
reasonable future?

3. If someone would start it, please consider use-case I've shown above.

  

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland