Csound Csound-dev Csound-tekno Search About

Re: [Csnd] OT: OOP question

Date2011-08-10 05:51
Fromkelly hirai
SubjectRe: [Csnd] OT: OOP question
if by recursively you mean dynamically, then you are looking at the 
Decorator design pattern:
http://en.wikipedia.org/wiki/Decorator_pattern

if you mean some shared resource between all objects of a particular 
class, you should look at static member variables aka class variable.
http://en.wikipedia.org/wiki/Class_variable

k.

On Wed, 10 Aug 2011, peiman khosravi wrote:

> Hello,
>
> I had a little question re OOP. Is is possible for an object (i.e. an
> instance of a class) to recursively modify some attributes of the class to
> which it belongs? If so is there a name for this?
>
> Thanks
>
> Peiman
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-08-10 15:26
Frompeiman khosravi
Subject[Csnd] OT: OOP question
Hello,

I had a little question re OOP. Is is possible for an object (i.e. an instance of a class) to recursively modify some attributes of the class to which it belongs? If so is there a name for this?

Thanks

Peiman 

Date2011-08-10 15:47
Fromzappfinger
Subject[Csnd] Re: OT: OOP question
You can override methods of your base class in the inherited class, but not
variables, I think, unless they have 'set' functions.
This does not affect the base class though.

Richard

--
View this message in context: http://csound.1045644.n5.nabble.com/OT-OOP-question-tp4685983p4686055.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-08-10 17:17
FromJustin Smith
SubjectRe: [Csnd] Re: OT: OOP question

This is language specific.

A common lisp object (or any other object in a CLOS based object system) for example has the power in practice to change not only its class, but also the rules defining the object system itself (and therefore the behaviors of all classes). If your question isn't "can" but instead "should", the standard answer is probably no. Unless you ask many ruby programmers (if I am not mistaken, they do it quite a bit and have a name for it: "monkey patching").

----- Original message -----
> You can override methods of your base class in the inherited class, but
> not variables, I think, unless they have 'set' functions.
> This does not affect the base class though.
>
> Richard
>
> --
> View this message in context:
> http://csound.1045644.n5.nabble.com/OT-OOP-question-tp4685983p4686055.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>                        https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>


Date2011-08-10 19:35
Frompeiman khosravi
SubjectRe: [Csnd] OT: OOP question
Thanks for all your replies. They are enlightening.

Best,

Peiman

On 10 August 2011 05:51, kelly hirai <khirai@ongaku.isa-geek.net> wrote:
if by recursively you mean dynamically, then you are looking at the Decorator design pattern:
http://en.wikipedia.org/wiki/Decorator_pattern

if you mean some shared resource between all objects of a particular class, you should look at static member variables aka class variable.
http://en.wikipedia.org/wiki/Class_variable

k.


On Wed, 10 Aug 2011, peiman khosravi wrote:

Hello,

I had a little question re OOP. Is is possible for an object (i.e. an
instance of a class) to recursively modify some attributes of the class to
which it belongs? If so is there a name for this?

Thanks

Peiman

Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Send bugs reports to the Sourceforge bug tracker
          https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"