The Artima Developer Community
Sponsored Link

Programming in Scala Forum
Wrapper proxy object

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Soren Mathiasen

Posts: 1
Nickname: sorenmat
Registered: Aug, 2010

Wrapper proxy object Posted: Aug 16, 2010 1:23 AM
Reply to this message Reply
Advertisement
Hi,

I need to use a wrapper/ proxy object in scala, but i don't know how. Let's say I have the following.

class Person(var name: String)

class wrapper(p: Person)

val w = new Wrapper(new Person("Test"))
the code i wanna execute is w.name, so my wrapper delegate the call to the wrapped object person. is this possible ?
Of cause this needs to be dynamic, so if i add a lastName on person i can call that without writing code...

Cheers, Soren

Topic: page 548 Previous Topic   Next Topic Topic: netbeans-6.9.1

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use