Solved

project mutual references problem (urgent)

Posted on 2002-04-20
5
214 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
table example 4 32
how to see all occupied ports on windows 10 laptop 15 76
Unhandled exception type Exception 18 42
Java 8 to Java 6 8 20
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

861 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