Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: changing moose object classes on the go

by moritz (Cardinal)
on Mar 19, 2013 at 18:40 UTC ( #1024356=note: print w/replies, xml ) Need Help??


in reply to changing moose object classes on the go

If I simply bless my $dog into LABRADOR then he won't be golden. How can I resolve this situation?

By creating a new LABRADOR object, and using it instead of the old object. You can reuse the attributes from the original DOG object.

Seriously, changing the type of an object is a an usual requirement, and might point to a flaw in your overall design. If a dog is a labrador, it's already born a labrador. Or phrased differently, time-dependent properties should not encoded in the type.

  • Comment on Re: changing moose object classes on the go

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024356]
help
Chatterbox?
[choroba]: How is Bembel different from Krug?
[hippo]: karlgoethebier, Ich habe kein Deutsch.
[Corion]: choroba: A Bembel is a traditional pottery ware, which is only(!) used for serving Cider (well, Apfelwein)
[shmem]: choroba: it's hessisch
[Corion]: Not every Krug is a Bembel!
[karlgoethebier]: there is just the mug: 🍺
[Corion]: A Bembel must look like this
[karlgoethebier]: https://de. wikipedia.org/ wiki/Bembel#/ media/File: Bembel_Zum_blauen_ Bock_1978.jpg
[choroba]: as my friend says, Ich stehe Deutsche ver nicht aber klein ;-)
[Corion]: Krug is generic pottery ware for pouring beverages, but a Bembel is painted with that blue paint and contains only (!) Apfelwein

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2017-05-24 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?