• 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
Re: pageWithName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pageWithName


  • Subject: Re: pageWithName
  • From: Simon McLean <email@hidden>
  • Date: Sat, 21 Jun 2008 10:15:53 +0100

you should do 

pageWithName(MyPageClass.class.getName());

if anything, because then it will be "seen" by all the refactoring tools in eclipse. So change the page name, move it to a different package etc. and you can confidently expect refactor to get it right.

the compiler will also pick up dead references if you ever deleted that page.

just about anywhere where you use strings in the old-fashioned wo-way you should no longer be doing so.

another example is

addobjectToBothSidesOfRelationshipWithKey(myObject, "myRelationship");

should now be

addobjectToBothSidesOfRelationshipWithKey(myObject, MyObject.MYRELATINOSHIP_KEY);

where MYRELATINOSHIP_KEY is a static string in the private super of your EO, which are automatically generated if you are using the standard veogen templates that come with wolips now.

i guess the modern motto is "avoid strings at all costs". they only bite you later :-)

Simon

On 21 Jun 2008, at 09:59, Neil MacLennan wrote:

then what's wrong with pageWithName("ClassName"), could I be using something different/better?

 _______________________________________________
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: 
 >DB Migration Paradigm? (From: "Yung-Luen Lan" <email@hidden>)
 >pageWithName (From: Neil MacLennan <email@hidden>)

  • Prev by Date: pageWithName
  • Next by Date: Practical Webobjects Utilities Framework
  • Previous by thread: pageWithName
  • Next by thread: Split Install Question vs. Direct Connect vs. Dev vs. Deploy
  • Index(es):
    • Date
    • Thread