On 7/8/11 01:20 , Raoul Duke wrote:
So, to summarize it seems to me that using Scala with Qi4j is an awesome
combo, if you can stand the fact that you have to use methods for all state
(persistent, injected stuff, temporary variables, etc.).

scala sorta supposedly tries to have the "uniform access principle",
does that help any? where it makes syntax that looks like direct
variable access but can really be methods?

Right, that does help. You can even make a "method that does assignment", like so:
trait Data
{
  @UseDefaults
  def foo: Property[String] // Define property
  def foo_=(v:String) = foo.set(v) // Operator overloading for =
}
and then:
trait Events
{
  self: Data =>
  def updatedFoo(newValue : String)
  {
    // Register change by modifying state
    foo = newValue
  }
}
where "foo = newValue" really is "foo(newValue)". So that's neat, I guess. Still...

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to