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 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