|
|
|
Re: Unique ID [message #848601 is a reply to message #848581] |
Wed, 18 April 2012 11:53 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Stacey,
Comments below.
On 18/04/2012 1:29 PM, Stacey Hopkins wrote:
> Thanks for the info I have extended the resource (XMIResourceImpl) and
> resourceFactory (XMIResourceFactoryImpl)
>
> ....I have a concern though that I am now relying on XMI to provide
> the id, I feel this is me now setting a dependency on the storage type?
Certainly a dependency on the resource implementation. Ideally other
resource implementations extend the XMI one and support their
specialized style via an option (like we do for OPTION_BINARY) and take
into account the object/id maps as part of what needs to be persisted.
> .... something that would be an additional thing to manage if ever
> moving the storage .... Is this correct?
Yes, potentially and perhaps likely, that's an issue.
>
> In addition is their any recommended good tutorials on using of
> derived attributes? {can't see any on my first look.} - Thanks Stacey
It's not that complicated. Typically you'd make the feature not
changeable, volatile, and derived in the model, and in that case only a
stub is generated for the getter in the implementation class so you must
implement the logic for it. You must ensure if your doing this for an
attribute that's an ID that the value you return will always be unique
with respect to all other IDs for objects in the same resource (even
objects of a different type).
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02919 seconds