[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

project mutual references problem (urgent)

Posted on 2002-04-20
5
Medium Priority
?
235 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This video teaches viewers about errors in exception handling.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 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