Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: perspective and object-disorientation

by castaway (Parson)
on Jan 18, 2003 at 12:28 UTC ( [id://227958]=note: print w/replies, xml ) Need Help??


in reply to perspective and object-disorientation

It's an interesting question..
You're looking at programming and OO as if you'd like to be able to define really complex systems with it (such as Real Life), to be able to use the exact same programm for different aspects at the same time. This doesn't really represent real life though. I would view a Person as something which changes states over time. He may be an Employee and a Trainspotter and a Father, but each of these states are not active simultaneously when they are being actively 'carried out'.
When writing a programm/object in which you want to look at the objects in a lot of different perspectives, its better to deal with a generic object, and set states for however you are looking at it at the time. (Person->atWork(), Person->atHome(), Person->atTheTrainStation().. )

As to changing @ISA at runtime, its not occured to me to do that, and I can't think of a reason to do it at the moment (a real one). It did however, just occur to me, that you can also change the inherited classes as you like as well, theres nothing to stop you doing 'use base (Blah.pm);' and then add stuff to Blah.pm in your code (package Blah.pm; changestuff), or eval'ing code at runtime to do this.

It sounds like you're thinking of writing a self-evolving program which can change its own objects as it likes... Fun..

C.

  • Comment on Re: perspective and object-disorientation

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://227958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found