another handy 1.5 tip
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