?
Solved

project mutual references problem (urgent)

Posted on 2002-04-20
5
Medium Priority
?
231 Views
Last Modified: 2010-03-31
I have two projects.

1) common - for common utilities, need to be general as it can.

2)ejb - contain EJB beans.

project ejb allow to have references to project common, but project common can not have references to ejb.

Unfortuntly one of the utility need to access specfic session EJB bean that is in the ejb project and activate specfic method,

how can i resolve this reference problem

Thanks in advance.
Nir
0
Comment
Question by:nir2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
gadio earned 300 total points
ID: 6957411
How about taking this utility and placing it in the EJB project? Or making it a 3rd project that is dependent on both common and EJB? Its not a common by your definition.

Regards,
Gadi
0
 
LVL 2

Author Comment

by:nir2002
ID: 6957426
Thanks Gadi for your fast answer.

I have already thought about putting it in the ejb project,
but the utility is general (not the part for accessing the EJB bean ofcourse) and also using threads and synchronization which is not allow in EJB, can it be solved by introducting of new interfaces that be in 3rd project like you suggest.

I prefer neither putting the whole utility in ejb project nor in other 3rd project unless I have no other choice.
0
 
LVL 4

Expert Comment

by:jos010697
ID: 6957562
You could define a proxy class that acts as if it were
an EJB. Everything passed to the proxy is passed to the
bean, everything returned from the bean is returned to
the invoker of the proxy method.

Don't pass the bean to the utility object directly, but
instead, wrap it in the proxy object and pass the proxy
to the utility instead. A simple interface definition
should do the tricky work ...

It doesn't matter in which project you'd stick the proxy
class (even project 3 would do fine)

kind regards
0
 
LVL 2

Expert Comment

by:coreyit
ID: 6958485
As gadio mentioned, it sounds like you need a new package. Seems like "common" should be objects common to all projects, and the utilities should move out of there in to a "util" package that can reference any others.

-corey
0
 
LVL 2

Author Comment

by:nir2002
ID: 6959001
The proxy approch seem intersting, it may solve my problem.
Can you elaborate more on the proxy approch?

Thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question