Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Realm usage
[Databinding] Realm usage [message #315600] Tue, 15 May 2007 12:26 Go to next message
Eclipse UserFriend
Originally posted by: thomas.x.hughes.jpmorgan.com

I kind of understand what Realms are for - synchronization of events from
IObservables. But how to use in a large(ish) system?

How many realms should I have? 1 or more? Can I set one Realm for the
whole program? Ideally I'd want something simple, I'm not too bothered by
performance. I'd also ideally like to avoid having
getRealmFromSomewhere().syncEexec(new Runnable()) everytime I update a
domain object.

My use case is that I'm using binding to bind domain objects to widgets -
no presentation model, I'm using Supervising Controller instead. This
binding always occurs in the SWT thread. There isn't that much threading
in my app, so domain objects also tend to get updated in the SWT thread,
however there are some examples of other threads with requirements to
update domain objects.

Any tips?
thanks, Tom
Re: [Databinding] Realm usage [message #315678 is a reply to message #315600] Fri, 18 May 2007 23:58 Go to previous message
Eclipse UserFriend
In most cases realms can be thought of belonging to a specific thread.
If you have multiple threads you'll need multiple realms.

Tom Hughes wrote:
> How many realms should I have? 1 or more? Can I set one Realm for the
> whole program?

As many as you need. If you just have one thread then run your code
with the SWT realm set as the default with Realm.runWithDefault(...).

I'd also ideally like to avoid having
> getRealmFromSomewhere().syncEexec(new Runnable()) everytime I update a
> domain object.

You can only avoid this if you're certain that all execution is
executing in the display thread. The same rule applies to realms as
does SWT. You don't always have to sync exec in order to access SWT.
But if there is doubt you need to sync exec from the display and the
same goes for realms.

-brad
Previous Topic:Proper protocol for enhancement requests and questionable bug fixes
Next Topic:[Databinding] - Policy Validate on update, Update on request
Goto Forum:
  


Current Time: Tue Jul 22 19:47:52 EDT 2025

Powered by FUDForum. Page generated in 0.05057 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top