• 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
another handy 1.5 tip
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

another handy 1.5 tip


  • Subject: another handy 1.5 tip
  • From: Mike Schrag <email@hidden>
  • Date: Thu, 2 Nov 2006 12:36:55 -0500

If you have a common superclass for your components, you can take advantage of covariant return types and override session() to return your own Session instance and avoid the casting in other calls to session(). You could always make another method named mySession(), but I thought this was kind of nice to be able to keep the original method name but have proper type checking.

  @Override
  public my.Session session() {
    return (my.Session) super.session();
  }

ms
_______________________________________________
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: Problem with Many-Many relationship
  • Next by Date: refreshing refetched objs
  • Previous by thread: Re: Problem with Many-Many relationship
  • Next by thread: refreshing refetched objs
  • Index(es):
    • Date
    • Thread