Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Business Logic in validateForSave?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Business Logic in validateForSave?




On Jan 28, 2009, at 9:16 PM, Kamal D Shah wrote:

Hi all,

I have been using D2W and have been managing quite well without having to write any code. However, I have run into a situation where I need to insert a bunch of objects when another object is being created. I was wondering if I could write this code in the validateForSave of the original object.

In a word, no. That is not a safe thing to do. http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-The+EOF+Commandments


For example, if I need to save a few Bar objects when I create a Foo, can I write the code for the creating of the Bar objects in the validateForSave of the Foo class? Well, I know I can. But I was wondering if this was a good way of doing this. Or is there a better way to achieve this without having to write my own component etc.


Use awakeFromInsertion.

Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ 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
References: 
 >Business Logic in validateForSave? (From: Kamal D Shah <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.