Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Derived *Objects*
Derived *Objects* [message #428144] Wed, 11 March 2009 17:04 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hey,

Imagine I have a bunch of objects that represent the same 'thing' but in
a different language. We could name them by a common string plus a
language extension, similar to how java I18N works.

Now, whenever I encounter such a localized object, I'd like to create
sort of a 'virtual', or 'placeholder' object that represents the *idea*
of that object, without referring to a concrete localized version. Of
course, that virtual object would only exist once for each set of
localized objects.

The concrete, localized objects are serialized, but I wouldn't want to
serialize the placeholder.

Any patterns or ideas?

Thanks for help,
Felix
Re: Derived *Objects* [message #428146 is a reply to message #428144] Wed, 11 March 2009 17:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Felix,

Comments below.

Felix Dorner wrote:
> Hey,
>
> Imagine I have a bunch of objects that represent the same 'thing' but
> in a different language. We could name them by a common string plus a
> language extension, similar to how java I18N works.
>
> Now, whenever I encounter such a localized object, I'd like to create
> sort of a 'virtual', or 'placeholder' object that represents the
> *idea* of that object, without referring to a concrete localized
> version. Of course, that virtual object would only exist once for each
> set of localized objects.
I'm not sure how you'd recognize that two instance represent localized
versions of the same thing? Most of the translation stuff works by
having only keys in the models/code and having the localizations be
separate, so perhaps you've gone down the wrong path from the start...
>
> The concrete, localized objects are serialized, but I wouldn't want to
> serialize the placeholder.
>
> Any patterns or ideas?
Not so much... Only a map from the "key" of the "idea" to a generic
instance to represent it comes to mind...
>
> Thanks for help,
> Felix


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Derived *Objects* [message #428194 is a reply to message #428146] Fri, 13 March 2009 07:13 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
As always,

thanks for your answer Ed. I think I now know what to do. Just for the
background:

> I'm not sure how you'd recognize that two instance represent localized
> versions of the same thing? Most of the translation stuff works by
> having only keys in the models/code and having the localizations be
> separate, so perhaps you've gone down the wrong path from the start...

My model domain is exactly that 'separate' place that you mention. The
objects represent resources (text or images) that may be localized. I
can see whether a resource is localized by looking at its URI, which is
basically an accessor to the physical location of the resource...)
Previous Topic:retrieve all related EPackages
Next Topic:[Teneo] Integrate EMF with Hibernate EntityManager persistence
Goto Forum:
  


Current Time: Thu Mar 28 12:15:57 GMT 2024

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

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

Back to the top