decorator and proxy

how would you differentiate the two. Structurally both look the same. I read somewhere "Decorator and Proxy have different purposes but similar structures." Could anybody shed some light on this
[201 byte] By [kilyasa] at [2007-10-3 5:21:09]
# 1

well Decorator adds behavior to an object whereas Proxy controls access to an object. However it seems that its a semantic difference more to deal with the nomenclature. So a user needs to name the proxy or decorator accordingly, however the design remains the same. Somebody please correct me if I am wrong

kilyasa at 2007-7-14 23:28:05 > top of Java-index,Java Essentials,Java Programming...
# 2

> Somebody please correct me if I am wrong

Nope, I think that was fine: both a proxy and a decorator wrap a target.

Structurally that's all they do in their basic form. One (the proxy) pretends

not to be there while the other (the wrapper/decorator) adds some

frivolites to the functionality originally present in the wrapped target.

kind regards,

Jos

JosAHa at 2007-7-14 23:28:05 > top of Java-index,Java Essentials,Java Programming...
# 3

> > Somebody please correct me if I am wrong

>

> Nope, I think that was fine: both a proxy and a

> decorator wrap a target.

> Structurally that's all they do in their basic form.

> One (the proxy) pretends

> not to be there while the other (the

> wrapper/decorator) adds some

> frivolites to the functionality originally present in

> the wrapped target.

>

> kind regards,

>

> Jos

thanx

kilyasa at 2007-7-14 23:28:05 > top of Java-index,Java Essentials,Java Programming...