Derived *Objects* [message #428144] |
Wed, 11 March 2009 17:04 |
Felix Dorner 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 |
Ed Merks Messages: 33148 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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02923 seconds