One more question: In the class employee i have private Job job;
If i proxy this Job reference, should it become: private IJob job; // where IJob is an interface to Job class. So, if i understand correctly: The interface must have ALL prottypes in it. So to answer my last email, IJob should extens IBaseBO. Any classes should reference the interface, not the object it is representing. I should type things as IJob, not Job. Am i right? Thanks, Daniel. ----- Original Message ----- From: "Daniel Perry" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 2:56 PM Subject: Re: dynamic proxies (simple question) > Thanks for the reply. > While waiting for someone to respond, i thought i'd give the "one simple > interface" a quick go.... > Sadly it doesnt work :) > > Oh well, eclipses refactoring tools will come in handy! > > A quick question regarding inherritance (assuming I[beanname] are interfaces > to bean properties): > Job extends BaseBO. > BaseBO implements IBaseBO. > IJob only interfaces the extra methods in Job over BaseBO. > > OJB doesnt know about the inherritance (ie it knows nothing about BaseBO). > getId is only interfaced in IBaseBO. Do i need to do anything more? > eg... > Should IJob extend IBaseBO? > Should Job implement IBaseBO? > > Thanks, > Daniel. > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, November 10, 2003 2:33 PM > Subject: RE: dynamic proxies (simple question) > > > > Hello Daniel, > > > > > -----Original Message----- > > > From: Daniel Perry [mailto:[EMAIL PROTECTED] > > > > > So my solution would seem to be proxies. The tutorial on > > > dynamic proxies isn't too clear. It says: > > > > > > "To use dynamic proxies the persistent class in question (in > > > our case the Article class) must implement an interface (for > > > example InterfaceArticle). This interface is needed to allow > > > replacement of the proper Article object with a dynamic proxy > > > implementing the same interface." > > > > > > My question is: what must this interface provide? > > > > I agree that this above text is not clear about this. > > > > The answer is: the interface must provide all methods > > your application needs to invoke. Typically these are > > all non-private methods of your BO. > > > > > Nearly all my BOs (all that i want to proxy) are subclasses > > > the BaseBO bean (with two properties - deleted and id). > > > Can i create an interface with just these two methods, or do > > > > If you try that and then change the types of all member > > variables to that interface, the compiler will certainly > > complain. > > > > > i have to create an interface for each bean, with all methods in it? > > > > Yes, this is probably what you should do. > > > > Olli > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
