Solved

project mutual references problem (urgent)

Posted on 2002-04-20
5
197 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
5 Comments
 
LVL 6

Accepted Solution

by:
gadio earned 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now