RE: [Compass-developer] Cyclic dependency
Brought to you by:
kimchy
|
From: Jeroen R. <Jer...@ve...> - 2005-05-27 12:51:08
|
Hi Shay,
=20
Thanks for your quick and elaborate reply.=20
=20
Since Compass brings the complexity of the problem down to just =
configuring it, this has become the same-old boring effort. So, some =
feature, for example an ant-task that could help generate the initial =
configuration of the model would be great.=20
=20
One of the biggest benefits of Compass is definitely its simplicity. It =
took me only a small amount of time to understand the concepts and to =
start using it. The samples are good and useful. I was missing some =
explanation about how inheritance in the model is treated, but after =
giving it some thought there is nothing to it. However I think this may =
be a common question, so you should point it out somewhere in the =
documentation or examples.
=20
At the moment we're using just Compass::Core, proving the concepts. If =
it is useful enough we will integrate it in our project using =
Compass::Spring. If we go ahead with this, we will of course have to go =
through the phase of loading our initial data into the search engine, so =
the GPS portion will probably be very useful here too, especially with =
the capabilities of listening to data changes in the underlying =
datastorages so the searchindexes can be updated as a result. All in =
all, it would just be a perfect fit in our system.
=20
Some explanation of our system, to give you some clues on the cyclic =
dependencies.=20
=20
We have a Services layer that has a number of configurable DAO layers =
that point to various downstream systems. One of these DAO-layers will =
make use of Compass.=20
=20
A simplified model could be described as follows:=20
=20
* Account
* has Profiles
=20
* Profile
* has account
=20
Some simple methods in our DAO layer may be:=20
=20
public Account findAccount() {
// Returns Account and its profiles
}
public Profile findProfile() {
// Returns Profile and its associated Account
}
=20
The above model shows a simple one-to-many, but this causes a cyclic =
dependency when configuring it in Compass. I am sure you have seen it =
yourself, it causes the VM to blow up with an OutOfMemory error (its =
looping in the MappingBindingSecondPass-class).=20
=20
Well, I could get around this issue by not configuring one of the =
associations (for example "has account").=20
When loading Account from the findAccount() method this is not a =
problem. The relation from Profile to Account can be populated after the =
search to fully populate the model.=20
When loading the Profile from the findProfile() method we have a =
problem. The relation from Profile to Account is not known, since we did =
not specify it...
=20
Hope you can help!
=20
Good luck with your work on Compass!
=20
Jeroen
=20
=20
=20
=20
=20
=20
=20
=20
________________________________
From: Shay Banon [mailto:ki...@ma...]
Sent: Fri 5/27/2005 1:18 PM
To: Jeroen Remmerswaal; com...@li...
Subject: Re: [Compass-developer] Cyclic dependency
Hi,
I am currently working on Compass::Gps, which means that in the next =
version you will be able to automatically index a database (very simple =
if you are using hibernate or ojb, or just simple directly pointing to =
the database). I added some features to Compass::Core as well, but =
cyclic dependencies was not high on my list (but you gave it a nudge and =
it moved up).
I will try to implement it in the next release (though cascading =
jumps immediately to mind, and that will be more complicated because of =
automatic dirty checking).
If you wish to find a workaround, I will need to know more about the =
system you are working on. Especially if you are using Compass as your =
data store as well (and not database, xml). Since if you are not using =
Compass as your sole data store, you can use it and your mappings from =
the data store to your domain model, to traverse the data. What I mean =
is that once you found something with compass, show it to the user, and =
than once it is selected, load the actual data from the persistent data =
store.
The next release is planned to be in about 4 to 5 weeks (maybe =
sooner), since we are changing many things in terms of documentation, =
the site, and Compass::Gps.
By the way, what do you think about compass, are there any other =
enhancements that you feel are missing and would like to see in the next =
version? What are modules are using with compass?
Cheers
Shay
On 27 May 2005, at 12:36, Jeroen Remmerswaal wrote:
Hello there,
=20
Knowing that there is no support yet for cyclic dependencies, are there =
any workarounds that I could use?
=20
Or, can you tell me when support is planned?=20
=20
Thanks,
Jeroen
=20
=20
=20
|