Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Role of a resource
[CDO] Role of a resource [message #645824] Mon, 20 December 2010 16:54 Go to next message
Dan Pollitt is currently offline Dan PollittFriend
Messages: 55
Registered: August 2010
Member
Hi,

I am just getting up to speed with using CDO (and EMF too really). I'm
looking for some advice on the use of a Resource within CDO.

If I have a heavily model-oriented system, what guidelines would I
follow for deciding how much of the model instance should sit within a
single Resource as opposed to splitting across multiple resources?

Would it be a "bad" thing to have my "world" live within a single
resource? I guess I'm having a little trouble in taking the concept of
resource == file in EMF to resource == ? in CDO.

Anyone got any tips?

Thanks,
Dan
Re: [CDO] Role of a resource [message #645874 is a reply to message #645824] Mon, 20 December 2010 20:43 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Dan,

In fact for CDO it doesn't matter how you split up your object graph into resources. I tend to see CDO resources as normal objects with a well-known name or, in other words, named entry points into the graph.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 20.12.2010 17:54, schrieb Dan Pollitt:
> Hi,
>
> I am just getting up to speed with using CDO (and EMF too really). I'm looking for some advice on the use of a Resource within CDO.
>
> If I have a heavily model-oriented system, what guidelines would I follow for deciding how much of the model instance should sit within a single Resource as opposed to splitting across multiple resources?
>
> Would it be a "bad" thing to have my "world" live within a single resource? I guess I'm having a little trouble in taking the concept of resource == file in EMF to resource == ? in CDO.
>
> Anyone got any tips?
>
> Thanks,
> Dan


Re: [CDO] Role of a resource [message #646431 is a reply to message #645874] Fri, 24 December 2010 06:29 Go to previous messageGo to next message
Hendy Irawan is currently offline Hendy IrawanFriend
Messages: 58
Registered: July 2009
Location: Bandung, Indonesia
Member

Thanks Eike, I hope you don't me jumping in and ask.

Suppose I have two CDO resources (connected to the same CDO repo):

ResourceA : Car --reference--> Color.

ResourceB : ColorCatalog --contain 0..*--> Color.

Suppose now I change the Color from within ResourceA, will ResourceB
get a change notification? (and vice versa?)

Is it necessary to do resourceA.save() to be notified?

Or is it not notified anyway and I have to reload resourceB in order to
get the changes in other resource?

Sorry, I haven't tried CDO yet but it's very interesting and I'd like
to know how it works.

Thank you Eike.


Eike Stepper wrote:

> Hi Dan,
>
> In fact for CDO it doesn't matter how you split up your object graph
into
> resources. I tend to see CDO resources as normal objects with a well-
known
> name or, in other words, named entry points into the graph.
>
> Cheers
> /Eike

--
Eclipse Driven Rich Application Development -
http://eclipsedriven.blogspot.com/
Re: [CDO] Role of a resource [message #646446 is a reply to message #646431] Fri, 24 December 2010 09:29 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 24.12.2010 07:29, schrieb Hendy Irawan:
> Thanks Eike, I hope you don't me jumping in and ask.
>
> Suppose I have two CDO resources (connected to the same CDO repo):
>
> ResourceA : Car --reference--> Color.
>
> ResourceB : ColorCatalog --contain 0..*--> Color.
>
> Suppose now I change the Color from within ResourceA,
An object generally has no sense through what handle it's being accessed, e.g. car.getColor().setRed(r) is identical to colorCatalog.getColors().get(0).setRed(r)

> will ResourceB
> get a change notification? (and vice versa?)
Change notifications are sent to adapters that are attachedto the modifed objects, generally not to the containing resources. Attachment and detachment of objects to the tree in a resource are an exception to this rule (although this does not go through the regular Notification mechanism).

> Is it necessary to do resourceA.save() to be notified?
In CDO the save() method of a resource delegates to the commit() method of the managing transaction. Committing a local transaction is needed to persist the changes and to distribute the resulting change notification to the other clients in the network. The local application is notified immediately when the change happens. In addition to EMF's adapter framework CDO offers some more centralized mechanisms for change notification, see CDOView.addObjectHandler() and CDOTransaction.addTransactionHandler(). Some more hints for remote change notification can be found in http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#How_can_I_reac t_to_remote_changes_to_my_objects.3F

> Or is it not notified anyway and I have to reload resourceB in order to
> get the changes in other resource?
In CDO resources do not have very special sematics. We consider them normal objects *with a well-known name* or *entry points into the object graph* .

> Sorry, I haven't tried CDO yet but it's very interesting and I'd like
> to know how it works.
It's easy to set up. I recommend to work through one or two of the tutorials then you quickly get a clue ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:Re: ANSI-C-model and dealing with redundant references
Next Topic:[CDO] What can I do with DynamicCDOObjectImpl ?
Goto Forum:
  


Current Time: Fri Apr 26 21:44:26 GMT 2024

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

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

Back to the top