I also have code where there is a simple downcast and it works just fine.
(Just like the ejb spec as you say) For what it's worth, the J2EE spec.
version 1.2 says this on page 2-4:
"J2EE apps are required to use the RMI/IIOP APIs (specifically the narrow
method of javax.rmi.PortableRemoteOjbect)..."
So a simple downcast works now but may not work in the future.
Gene
Dr. Gene De Lisa
Rockhopper Technologies, Inc.
75 Trueman Ave.
Haddonfield, NJ 08033-2529
(609) 616 0950
http://www.rockhoppertech.com/gene
-----Original Message-----
From: Chris Kirby [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 12, 1999 4:04 PM
Subject: When to narrow remote object references
Hi all,
As of late, the software architecture group on our project has been having a
lively discussion
on when you are required to narrow remote object references.
Depending on how you interpret various sections of the specification,
specifically those on
type narrowing, you are required to narrow all remote object references, no
matter how they
are obtained (e.g. from create() methods on homes, from entity finder
methods,
etc.), although
the examples provided in the spec. do not demonstrate this behaviour.
If you read the type narrowing sections only as warnings about using direct
casts, it appears that
you are only required to narrow broad references returned from sources such
as
JNDI
(home interfaces), or Handle.getEJBObject(). Interfaces returned from
create()'s, find<Method>
methods, etc. where the desired type is well-known, will be narrowed by the
container (consistent
with the examples provided in the specification).
Now I know that narrow'ing references, regardless of how they're obtained
will
work, and is
likely good practice, but I'd like to know what is required as the spec.
intended it.
Cheers...
---
Chris Kirby E-mail: [EMAIL PROTECTED][EMAIL PROTECTED]
IBM Canada Phone: 204.934.8980 (IBM office) OR
7 - 201 Portage Avenue 204.948.3559 (Client site)
Winnipeg, MB R3B 3K6 Fax: 204.934.8844
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".