Hi Art,

On Feb 9, 2006, at 2:16 PM, Art Isbell wrote:

On Feb 9, 2006, at 12:03 PM, Chuck Hill wrote:

Let's collect these.  I've added one more:

http://www.wodev.com/cgi-bin/WebObjects/WODev.woa//wa/Main? wikiPage=WebObjectsBestPractices

        The added WO Best Practice:

Rather than use
 MyEO eo = new MyEO();
 ec.insertObject(eo);
Prefer this form:
 MyEO eo = (MyEO) EOUtilities.createAndInsertInstance(ec, "MyEO");

If this is good:

MyNewPage nextPage = (MyNewPage)pageWithName (MyNewPage.class.getName());

then why not this?

MyEO eo = (MyEO) EOUtilities.createAndInsertInstance(ec, MyEO.class.getName());

:-)

Good question, and one that I should add to the best practice. The second parameter is the entity name from the model, not the class name. For component creation it is the class name. The thing is that entity.name != class.name most of the time. The class names in my model include package names, but the entity names do not. Also, I've run across cases where multiple entities in the model are implemented by the same class. Gary Teter makes good use of this in the WireHose frameworks.

Chuck

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to