During my daily work in another framework, we are able to do something very handy like so:
myThing := Thing findOrCreateByKey: 'red_thing'.
where the key is some underscored all lower case unique name for an object we will be calling all the time.
this will return either a new thing with a key of 'red_thing' or the current one that already exists.
We can also do something like:
myThing updateWithDictionary: aDictionary.
and it will flip through the dictionary and assign values to the instance variables.
The above is very handy.
I am currently creating a bunch of methods that populate my image with real objects, and could use these methods.
My question is. Does a behavior like this already exist? If not, I'd like to add these methods to my project (in monticello). They will be used with several different objects, so should I add the methods to Object?
I would imagine this is something I would want to use a great deal. How would I go aobut making this something I could include easily in further projects?
I realize that the 'updateWithDictionary' is very inefficient, but this will just be somethign that runs once, during data import, and never again.
I just want to make sure I am not doing anything whacky.
Thanks!