New answers tagged scala
In scala it is still useful to map database tables to objects, and there are several ways of doing it. One popular framework in the world of Scala is slick. It is not an ORM, because it does less (namely, it doesn't fetch relationships without being told to do joins explicitly). So you still map objects to database rows, but your objects are immutable, ...
Not sure if this is the most idiomatic way, but take a look at function grouped: myRange.grouped(groupSize) This "groups" your Range (or any collection, really) into subgroups of size groupSize and returns an iterator, but it can be converted to the collection type you need.
Well, one thing that's important to do whenever we have a discussion like this is to clearly distinguish between object relational mappers ("ORM") and database abstraction layers. An ORM is a kind of database abstraction layer, but not all database abstraction layers are ORMs. One good tool to study to grasp this is Python's popular SQLAlchemy library, ...
It's kind of hard to explain until you've done a lot of functional programming. In object-oriented programming, your data is sort of stuck in one object and stays there. That object gets passed around a bit, and modified quite a bit, but you're usually fundamentally working with the same "identity" over the lifetime of that data. ORMs are generally ...
Top 50 recent answers are included