My Scala Base

Adventures in Scala

All Blog Posts (11)

Steve Yen More Hibernate In Scala: Annotations versus external XML versus inline XML

I've been tweaking the Hibernate in Scala example from my previous post.

The experiment is to interleave the hbm.xml mapping information right into your plain old scala object code. Sort of like a poor man's annotation, so you can keep your meta information right snug up to your properties. This helps get around Scala's current limitations around deep annotations (so I heard).

Here's an ex… Continue

Added by Steve Yen on January 24, 2008 at 11:40pm — 1 Comment

Steve Yen Hibernate with Scala example in one file

Just worked through Hibernate's tutorial, but using Scala. Googling for hints turned up info from Matt Hellige's blog(s) and Viktor Klang from the lift web group. So with a tip of the hat to them, here's a working example of using Hibernate from Scala, in a single file. Enjoy...

package scalanateimport scala.xml._
import java.util.Date
import org.hibernate._
import org.hibernate.cfg._

class Event {
  var id: Long = 0L 
  var title: String = null
  var date: Date = null 
  var p
Continue

Added by Steve Yen on January 24, 2008 at 7:08pm — No Comments

Steve Yen Who would win? Lift versus the Autobots?

Found this awesome sounding creature on my lift explorations:

object User extends User with MetaMegaProtoUser[User, User with KeyedMetaMapper[Long, User]]

Meta Mega Proto User!!

Now… Continue

Added by Steve Yen on December 28, 2007 at 10:16am — No Comments

Steve Yen Inline Scala Tables

Another whoa moment today -- ran across a pointed, concise Scala code snippet in Eric Torreborre's announcement of the specs 1.1 testing library...

"a calculator" should {
"provide an add operation" in {
"a" | "b" | "result" |>
1 ! 2 ! 3 |
5 ! 2 ! 7 |
3 ! 0 ! 3 | {
(a: Int, b: Int, result: Int) => { calc.add(a, b) must_== result }
}
}
}

The above is a great e… Continue

Added by Steve Yen on December 20, 2007 at 9:54am — No Comments

Steve Yen Hmmm, Lift Uses Maven

While trying to get the latest version of the lift web framework (0.3.0) for Scala, I updated to maven 2.0.8, and then per the announcement instructions typed...

mvn archetype:create -U \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=0.3.0 \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=com.test \
-DartifactId
Continue

Added by Steve Yen on December 19, 2007 at 9:30pm — No Comments

Steve Yen All this has happened before and will happen again

Watching Scala's development so far, it sure seems like I've seen this before.

It smells like early Ruby on Rails history. A lot of alpha geeks eventually picked up Rails for productive web app development, and fell in love with Ruby along the way.

Scala has a chance of reprising that plot line. It's a fine language. But, an important distinction -- Scala can also play well at an entirely lower level than Ruby.

Sure, just like with Ruby/Rails, you can also write a… Continue

Added by Steve Yen on December 18, 2007 at 10:00pm — No Comments

Steve Yen Searching for Scala Operator Overloading

Chalk up one more downside to operator overloading in Scala (and, I presume other languages)... you can't search the interwebs for more information on operators. Google, for example, pretty much ignores punctuation characters.

Let's say you see some Scala code out there like "parallelCoordinator !? ProcessEnd". What does that '!?' mean?

Related, what does '_*' mean in 'x:_*'?

Ouch, Google doesn't know! It's so last millenium -- guess I'll have to do actual linear doc… Continue

Added by Steve Yen on December 18, 2007 at 4:56pm — No Comments

Steve Yen Scala Version

forgot to mention: I'm using scala 2.6.1 RC2
Continue

Added by Steve Yen on December 18, 2007 at 12:27pm — No Comments

Steve Yen Which Java?

platform details: I'm using java 6 (jdk 6 update 3) for all my experiments here on Scala Base, on Windows Vista. YMMV

Continue

Added by Steve Yen on December 18, 2007 at 11:43am — No Comments

Steve Yen Actor Isolation == Erlang process?

Research Question 1: Is it possible to get Erlang-style process isolation using Scala Actors?

The goal -- I want an isolated Scala Actor (shall we call them Monologuers?) that can't muck around with the state of another Monologuer, except through explicit mailbox messages. Ideally, I'd like to just do this by adding a library, instead of hacking the Scala language, similar to how Actors themselves were introduced into the Scala world.

The answer, doh, seems to be… Continue

Added by Steve Yen on December 18, 2007 at 11:36am — No Comments

Steve Yen hello world

just opened up scala base -- let's see how good ning is...
Continue

Added by Steve Yen on December 18, 2007 at 10:26am — No Comments

About

Steve Yen Steve Yen created this social network on Ning.

Create your own social network!

© 2009   Created by Steve Yen on Ning.   Create Your Own Social Network

Badges  |  Report an Issue  |  Privacy  |  Terms of Service