RE: [JBoss-user] access modifiers lost in EJB programming ?
According to the java language specification an interface is inherently PUBLIC and ABSTRACT. If you try to use any access attribute such as PROTECTED or PRIVATE, you will get a syntax error. Since the EJB home and remote objects are defined as interfaces, there is no way to limit visibility through access attributes such as PRIVATE or PROTECTED. -Original Message- From: fractals [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 7:36 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] access modifiers lost in EJB programming ? I don't think of an interface as a "pattern specifically about the publicly available views/facets of an object". You can define interfaces that are visible only from the package, and in fact, this is a feature that I use often in my designs. In my opinion, interfaces are a means for specification: they state what you have to implement if you want to be coherent with your designs. That is something that applies as well for what you intend for the general public as for what you intend for your application's internals. In EJB, I see the home and remote interfaces for a specification as well: they state what features you want the container/application server to exhibit from a specification you give and partially implement. I the case of ejb-references, you could want to make calls on remote objects that you wouldn't want others to see. But if I'd like to have something like this in j2ee, it's probably due to the fact that I'm a beginner in using those tools ;-) regards, candide > There is no way to define anything but public method in any interface. This > is not limited to remote interfaces or EJB. Interfaces are an OO pattern specifically > about the publicly available views/facets of an object. If you want to hide > some method of an EJB implementation then don't put the method in the > public interface. EJB adds the ability to restrict who can access the public > methods as well, so if the method should be available to some you have > this path as well. > > - Original Message - > From: "fractals" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, March 05, 2001 2:37 PM > Subject: [JBoss-user] access modifiers lost in EJB programming ? > > > > AFAIK, there's no way to make a method anything else than public in a remote > > interface. Sad, because I *would* like to hide some of the methods I define > > for some of my beans. > > > > Really, is there no way to get this cornerstone of OO programming back into > > the EJB realm ? > > > > Thanks, > > > > candide > > > > > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
> hi, > > On Mon, 5 Mar 2001, fractals wrote: > > > AFAIK, there's no way to make a method anything else than public in a remote > > interface. Sad, because I *would* like to hide some of the methods I define > > for some of my beans. > > > > Really, is there no way to get this cornerstone of OO programming back into > > the EJB realm ? > > if you can afford the overhead you could make facade session beans that > are hiding methods that you don't want to publish. > yes, that's right, good idea. Thanks. For now, I didn't bother very much with this one, as my code can come with a policy in its documentation. But in the mid term, I think I'll give a try to the role things too. Thank you. candide ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
hi, On Mon, 5 Mar 2001, fractals wrote: > AFAIK, there's no way to make a method anything else than public in a remote > interface. Sad, because I *would* like to hide some of the methods I define > for some of my beans. > > Really, is there no way to get this cornerstone of OO programming back into > the EJB realm ? if you can afford the overhead you could make facade session beans that are hiding methods that you don't want to publish. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
- Original Message - From: "Guy Rouillier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, March 24, 2001 8:59 PM Subject: Re: [JBoss-user] access modifiers lost in EJB programming ? > Interesting this topic should come up now. I've been wondering why EJBs are > not defined as implementing their remote interfaces. A session bean, for > example, is defined as implementing only SessionBean, and not its own remote > interface. I agree with your sentiment below, that an interface is a > specification. IMHO, EJBs should be defined as implementing their remote > interfaces, as that interface is the spec to which clients are written. > This would enable the compiler to ensure that the EJB has completely > implemented its remote interface. > The deployment phase of an EJB typically verfies that the EJB has implemented the interface correctly. If you want to ensure that this is the case use the common pattern of defining your business interface and then inheriting the EJB remote interface from it and have your bean implement it: public interface IHello { public String hello() throws RemoteException; } public interface Hello extends EJBObject, IHello { // No new methods } public class HelloBean implements IHello, SessionBean { public String hello() { ... } ... } ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
Interesting this topic should come up now. I've been wondering why EJBs are not defined as implementing their remote interfaces. A session bean, for example, is defined as implementing only SessionBean, and not its own remote interface. I agree with your sentiment below, that an interface is a specification. IMHO, EJBs should be defined as implementing their remote interfaces, as that interface is the spec to which clients are written. This would enable the compiler to ensure that the EJB has completely implemented its remote interface. - Original Message - From: fractals <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 06, 2001 7:35 AM Subject: Re: [JBoss-user] access modifiers lost in EJB programming ? > I don't think of an interface as a "pattern specifically about the publicly > available views/facets of an object". You can define interfaces that are > visible only from the package, and in fact, this is a feature that I use > often in my designs. In my opinion, interfaces are a means for > specification: they state what you have to implement if you want to be > coherent with your designs. That is something that applies as well for what > you intend for the general public as for what you intend for your > application's internals. > > In EJB, I see the home and remote interfaces for a specification as well: > they state what features you want the container/application server to > exhibit from a specification you give and partially implement. I the case of > ejb-references, you could want to make calls on remote objects that you > wouldn't want others to see. > > But if I'd like to have something like this in j2ee, it's probably due to > the fact that I'm a beginner in using those tools ;-) > > regards, > > candide > > > There is no way to define anything but public method in any interface. > This > > is not limited to remote interfaces or EJB. Interfaces are an OO pattern > specifically > > about the publicly available views/facets of an object. If you want to > hide > > some method of an EJB implementation then don't put the method in the > > public interface. EJB adds the ability to restrict who can access the > public > > methods as well, so if the method should be available to some you have > > this path as well. > > > > - Original Message - > > From: "fractals" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, March 05, 2001 2:37 PM > > Subject: [JBoss-user] access modifiers lost in EJB programming ? > > > > > > > AFAIK, there's no way to make a method anything else than public in a > remote > > > interface. Sad, because I *would* like to hide some of the methods I > define > > > for some of my beans. > > > > > > Really, is there no way to get this cornerstone of OO programming back > into > > > the EJB realm ? > > > > > > Thanks, > > > > > > candide > > > > > > > > > > > > ___ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] access modifiers lost in EJB programming ?
>I don't think of an interface as a "pattern specifically about the publicly >available views/facets of an object". You can define interfaces that are >visible only from the package, and in fact, this is a feature that I use >often in my designs. In my opinion, interfaces are a means for >specification: they state what you have to implement if you want to be >coherent with your designs. That is something that applies as well for what >you intend for the general public as for what you intend for your >application's internals. Right, contract specification is a better definition of an interface. Using package level access modifiers to restrict access to who can use the contract interface is a mechanism that does not translate to distributed access. >In EJB, I see the home and remote interfaces for a specification as well: >they state what features you want the container/application server to >exhibit from a specification you give and partially implement. I the case of >ejb-references, you could want to make calls on remote objects that you >wouldn't want others to see. > >But if I'd like to have something like this in j2ee, it's probably due to >the fact that I'm a beginner in using those tools ;-) > Right, EJB home and remote interfaces are specifications. You also have the ability to specifiy that only certain types of roles are allowed to access some or all of the methods in either interface. A package level access restriction is simply a restriction of the form, only allow access by entities who have the role "I'm in package x.y.z". Using EJB method-permissions you can define access contraints in a way that translates to distributed access. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
I don't think of an interface as a "pattern specifically about the publicly available views/facets of an object". You can define interfaces that are visible only from the package, and in fact, this is a feature that I use often in my designs. In my opinion, interfaces are a means for specification: they state what you have to implement if you want to be coherent with your designs. That is something that applies as well for what you intend for the general public as for what you intend for your application's internals. In EJB, I see the home and remote interfaces for a specification as well: they state what features you want the container/application server to exhibit from a specification you give and partially implement. I the case of ejb-references, you could want to make calls on remote objects that you wouldn't want others to see. But if I'd like to have something like this in j2ee, it's probably due to the fact that I'm a beginner in using those tools ;-) regards, candide > There is no way to define anything but public method in any interface. This > is not limited to remote interfaces or EJB. Interfaces are an OO pattern specifically > about the publicly available views/facets of an object. If you want to hide > some method of an EJB implementation then don't put the method in the > public interface. EJB adds the ability to restrict who can access the public > methods as well, so if the method should be available to some you have > this path as well. > > - Original Message - > From: "fractals" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, March 05, 2001 2:37 PM > Subject: [JBoss-user] access modifiers lost in EJB programming ? > > > > AFAIK, there's no way to make a method anything else than public in a remote > > interface. Sad, because I *would* like to hide some of the methods I define > > for some of my beans. > > > > Really, is there no way to get this cornerstone of OO programming back into > > the EJB realm ? > > > > Thanks, > > > > candide > > > > > > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
There is no way to define anything but public method in any interface. This is not limited to remote interfaces or EJB. Interfaces are an OO pattern specifically about the publicly available views/facets of an object. If you want to hide some method of an EJB implementation then don't put the method in the public interface. EJB adds the ability to restrict who can access the public methods as well, so if the method should be available to some you have this path as well. - Original Message - From: "fractals" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 05, 2001 2:37 PM Subject: [JBoss-user] access modifiers lost in EJB programming ? > AFAIK, there's no way to make a method anything else than public in a remote > interface. Sad, because I *would* like to hide some of the methods I define > for some of my beans. > > Really, is there no way to get this cornerstone of OO programming back into > the EJB realm ? > > Thanks, > > candide > > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] access modifiers lost in EJB programming ?
If it's not public, why is it in the interface? fractals wrote: > > AFAIK, there's no way to make a method anything else than public in a remote > interface. Sad, because I *would* like to hide some of the methods I define > for some of my beans. > > Really, is there no way to get this cornerstone of OO programming back into > the EJB realm ? > > Thanks, > > candide > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user -- Dan Christopherson (danch) nVisia Technical Architect (www.nvisia.com) Opinions expressed are mine and do not neccessarily reflect any position or opinion of nVISIA. --- If you're a capitalist and you have the best goods and they're free, you don't have to proselytize, you just have to wait. -Eben Moglen ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user