Re: OT : Coding Standards (was New WebObjects 15 Minute Tutorial in Quicktime)
Re: OT : Coding Standards (was New WebObjects 15 Minute Tutorial in Quicktime)
- Subject: Re: OT : Coding Standards (was New WebObjects 15 Minute Tutorial in Quicktime)
- From: Arturo PĂ©rez <email@hidden>
- Date: Sun, 28 Mar 2004 22:10:49 -0500
On Mar 28, 2004, at 8:49 PM, Owen McKerrow wrote:
Hi All,
1) He didn't make a java class of his Entity, he just imported the
EOModel
IME, naive users of WO make the Java classes for all entities,
including those that are usually referred to as enumeration entities
(these are used to label control values; e.g. a table with two columns:
code & label). A lot of entities are just data and no logic. In those
cases, there's no need to generate the java classes.
The next level (mine I'm no expert) is to only create those classes
that have truly undeniable business logic. In this situation, I use a
lot of the EOUtilities routines for dealing with entities with no
specific class and I use takeValueForKey for everything. In fact, I
even rip out the casting that WOBuilding puts in for WOComponents and I
just use takeValueForKey for those, too. It makes the code more
uniform at the added (slight) risk of runtime errors. The trick of
takeValueForkey works because it will call setKey if you have one.
But the reason I leave the entities as EOGenericRecords is because it
is easier to refactor. Once I have a good feel the the business logic
associated with a class then I generate the class and add the logic. I
think some people use the Gap design pattern (and EOGenerator) to
address this need but I haven't gotten there myself yet.
I think the wizards do wild and wooly things like create the Entities
at runtime using Java/Objective-c reflection and EOModelGroup (the
class) capabilities that scare me :-)
On 28/03/2004, at 9:36 AM, Kieran Kelleher wrote:'
This is great for beginners ........... courtesy of the Jonathan
'Wolf' Rentzsch at the Red Shed
here is the URL:
http://rentzsch.com/webobjects/wo5in15
----
WO in philadelphia - wanna cheesesteak with that?
Please visit webobjects.meetup.com.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.