Solved

project mutual references problem (urgent)

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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 …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

759 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

17 Experts available now in Live!

Get 1:1 Help Now