Re: Objectgraph question
Re: Objectgraph question
- Subject: Re: Objectgraph question
- From: Guido Neitzer <email@hidden>
- Date: Mon, 24 Jul 2006 08:16:01 +0200
On 24.07.2006, at 1:13 Uhr, Arturo Pérez wrote:
I've had similar problems. My solutions boil down to knowing when
to refresh the array backing the EOArrayDatasource.
So, you do know this from the actions your application performs or
from a generic approach?
I think, worse case, I just compare the current array to the one I
have and if they are different, I refresh. Not a scalable solution
but it works in my situation for now.
I have gone a little different way: my entities broadcast a
notification through the app when they are inserted or deleted. This
can be switched off for special entities via Properties because I do
some more inserts during the request-response loop (track a "has been
seen" status for several objects, a "recently seen by" status, object
modifications, some logging stuff and so on - stuff I'm not
interested in the rest of the app).
Edit/Inspect pages refresh their objects when such a notification
comes regardless whether this is necessary or not (because there may
be relationships to objects that have changed, and I was to lazy to
compare everything - perhaps I'll do this someday), list components
refresh when the entity name in the notification (I put this in the
user dict) matches against a list of names to watch. This works well
but generates some more traffic between EOF and the database because
objects are fetched more often.
I'm not really happy with this solution as it generates some more
traffic and I still have to take care of cross instance
synchronization but it works well and is not too bad from the
performance point. As an advantage it involves only a couple of
classes to get it working: the EO superclass I use, the edit/inspect
page superclass and the list superclass (and a couple more
specialized pages, okay) and I don't have to "know" when I have to
take care of objects that might change.
It is not, that this solution isn't working well, it's just that I'm
curious how other people solve this as it seems to me, that this is a
very common problem - and my way of solving it seems a little bit
weird to me.
cug
--
PharmaLine, Essen, GERMANY
Software and Database Development
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden