Hi All (with special greetings to Chuck and Sacha),

In my eternal quest to eliminate all of my bug-prone Davecode™, I've finally 
finished off my re-implementation of EOCopyable.

https://github.com/amagavi/wonder/blob/f431b5ac851becbb17082d8d195e19d36af50fb7/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXCopyable.java

I've called it ERXCopyable and while it is fundamentally based on what Chuck 
and Sacha put together for Practical WebObjects, my revisions make use of Java 
generics for better type safety and also make it entirely possible to control 
the copy process from within an Entity's EOModel UserInfo dictionaries.

I wet so far as to also craft additions to the EOGenerator templates that 
eliminate the need to write any code at all for most copy tasks. The template 
will automatically add the "implements ERXCopyable" to any Entity you've 
flagged with a "ERXCopyable" key, and do the work of writing the methods 
required by the interface. You simply specify on attribute and relationship how 
you want them to be copied and ERXCopyable takes care of all the work!

I even included some behaviors beyond the simple "Reference", "Shallow" and 
"Deep" copying, including "Nullify" and "CurrentTimestamp" to eliminate the 
developer (me) having to write any code at all if all that needs to be done is 
is leave the attribute or relationship null or override a NSTimestamp attribute 
with the current timestamp. I'm considering adding others such as "Increment" 
and "UUID" but I don't want to get too carried away with hiding logic in the 
EOModel file.

The Javadoc provides extensive documentation on how to use it, but please feel 
free to ask questions and suggest improvements so I can make it even easier to 
understand!

Dave

—————————————————————————————
WebObjects - so easy that even Dave Avendasora can do it!™
—————————————————————————————
David Avendasora
Senior Software Abuser
Kaiten, Inc.




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to