This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I don't know what this has to do with EJBs, or what you mean by that final question -- but I can tell you that the "new Widget(this)" pattern you're using is common and a good way to do things. Telling an object you create "here is how to get back to me" is a good idea.
I think you can pass a this reference into something inside the class in your constructor. That panel is a field of the class, so it is "inside". Now, letting a this reference get outside the class from inside the constructor, that is something altogether different.
Don't Swing components have a getParent() method, and automatically record their parent component? Or have I misunderstood the problem?
Joined: Dec 27, 2002
a getParent() function? Excuse me, I fell off my chair.
Dave Elwood wrote: . . . >>If it doesn't work, it doesn't work.
Thanks a lot.
I didn't mean it like that!
Maybe you should have some sort of class which incorporates the connection, and add both the EJB and the container to it.
Or create a Mouse Listener which takes a click ffrom the container and calls a method in the EJB
Can't think of anything else to suggest. Sorry. Anybody else?
3. the Panel creates a BurpEvent object and calls processBurps() with it. Again in the dumbest place possible,
in the event source object, Panel.
4. processBurps() picks out the MyBurpListener object and calls the BurpOccured() member.
Problem : I want things to happen in BigForm, not in MyBurpListener. I'm forced to put MyBurpListener in the Panel project
area so as a result BigForm in inaccessible to MyBurpListener. Why there? Because it's the only place to
put MyBurpListener so that both the Panel project and the BigForm project have access to it.
Solution : Anonymous Inner Class
Events : the right way :
1. in BigForm call
2. - 4. as above
Joined: Oct 13, 2005
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Communication between a EJB and its container