Link Details

Link 138492 thumbnail
User 232540 avatar

By eishay
via eishay.blogspot.com
Published: Dec 04 2008 / 18:20

I know it should work, but didn't see and reference that it does. So I tried it out and, of course, it does. Since the service object will be represented by an AopProxy which is basically a Java proxy, you must have the service to implement a Java Interface (proxy can be created only to interfaces). Scala does not have the notion of interfaces like Java, but the language creators did invested a lot in compatibility with java. Creating a plain Scala trait spits out a POJI (Plain Old Java Interface), which solves the issue. And even though declaring checked exception is not native to Scala, they did enabled the special throws annotation for that which helps in case your service must declare some kind of remote exception.
  • 7
  • 0
  • 814
  • 133

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (7)



Voters Against This Link (0)