• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ERXCopyable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERXCopyable


  • Subject: ERXCopyable
  • From: David Avendasora <email@hidden>
  • Date: Mon, 11 Feb 2013 14:54:51 +0800

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: D2W question: sort ordering and reverting to original sort order
  • Next by Date: cheatsheet ?
  • Previous by thread: Re: D2W question: sort ordering and reverting to original sort order
  • Next by thread: cheatsheet ?
  • Index(es):
    • Date
    • Thread