librelist archives

« back to archive

VARIANT and G_VALUE

VARIANT and G_VALUE

From:
Paolo Redaelli
Date:
2013-08-05 @ 07:54
I liked Cyril idea on VARIANT and TYPED_VARIANT and I'm implementing it
into database wrappers.
Then I read gobject's G_VALUE discovering that GObject's variant would not
fit in that design, as they have just one "polymorphic" class offering all
kind of creation clauses.
Of course the untyped parent/typed heirs fits better in a proper OO design
as it's naturally extensible.
Do you think it would be necessary to add several TYPED_VARIANT heirs to
G_VALUE, such as G_STRING_VALUE (...) which are heirs of both
TYPED_VARIANT[STRING], G_VALUE ?

Re: [libertyeiffel] VARIANT and G_VALUE

From:
Cyril Adrian
Date:
2013-08-09 @ 10:43
Hi Paolo,

This needs some thought, and deserves a detailed answer; and I have a bit
of research to do since I don't really know the gobject architecture.

So I will not answer right now :-)

Cheers,

*Cyril A**DRIAN*

[image: 
Facebook]<http://s.wisestamp.com/links?url=https%3A%2F%2Fwww.facebook.com%2Fcyril.adrian>
[image:
Twitter]<http://s.wisestamp.com/links?url=https%3A%2F%2Ftwitter.com%2Fcadbart>
[image:

LinkedIn]<http://s.wisestamp.com/links?url=http%3A%2F%2Ffr.linkedin.com%2Fin%2Fcadrian%2F>
[image:
Google 
Plus]<http://s.wisestamp.com/links?url=https%3A%2F%2Fplus.google.com%2Fu%2F0%2F100388810006463519079>
Contact me: [image: Google Talk] cyril.adrian@gmail.com
  Free signature tool.

<http://s.wisestamp.com/links?url=http%3A%2F%2Fr1.wisestamp.com%2Fr%2Flanding%3Fpromo%3D32%26dest%3Dhttp%253A%252F%252Fwww.wisestamp.com%252Femail-install%253Futm_source%253Dextension%2526utm_medium%253Demail%2526utm_campaign%253Dpromo_32>
CLICK
HERE TO GET 
IT.<http://s.wisestamp.com/links?url=http%3A%2F%2Fr1.wisestamp.com%2Fr%2Flanding%3Fpromo%3D32%26amp%3Bdest%3Dhttp%253A%252F%252Fwww.wisestamp.com%252Femail-install%253Futm_source%253Dextension%2526utm_medium%253Demail%2526utm_campaign%253Dpromo_32>
​


2013/8/5 Paolo Redaelli <paolo.redaelli@gmail.com>

> I liked Cyril idea on VARIANT and TYPED_VARIANT and I'm implementing it
> into database wrappers.
> Then I read gobject's G_VALUE discovering that GObject's variant would not
> fit in that design, as they have just one "polymorphic" class offering all
> kind of creation clauses.
> Of course the untyped parent/typed heirs fits better in a proper OO design
> as it's naturally extensible.
> Do you think it would be necessary to add several TYPED_VARIANT heirs to
> G_VALUE, such as G_STRING_VALUE (...) which are heirs of both
> TYPED_VARIANT[STRING], G_VALUE ?
>

Re: [libertyeiffel] VARIANT and G_VALUE

From:
Cyril Adrian
Date:
2013-09-15 @ 00:53
Hi Paolo,

I read your mail again. I think last time I misread it since I thought my
answer would be quite long.

In fact my answer is short: of course you can subclass TYPED_VARIANT if you
feel the need for e.g. specific creation routines.

Just one question, why wouldn't G_VALUE simply play the role of VARIANT?
Hence G_VALUE <- TYPED_G_VALUE[E_] — or, if G_VALUE just provides code, why
could you not just insert it (instead of inherit)?

Cheers,

*Cyril A**DRIAN*

[image: 
Facebook]<http://s.wisestamp.com/links?url=https%3A%2F%2Fwww.facebook.com%2Fcyril.adrian&sn=>
[image:
Twitter]<http://s.wisestamp.com/links?url=https%3A%2F%2Ftwitter.com%2Fcadbart&sn=>
[image:

LinkedIn]<http://s.wisestamp.com/links?url=http%3A%2F%2Ffr.linkedin.com%2Fin%2Fcadrian%2F&sn=>
[image:
Google 
Plus]<http://s.wisestamp.com/links?url=https%3A%2F%2Fplus.google.com%2Fu%2F0%2F100388810006463519079&sn=>
Contact me: [image: Google Talk] cyril.adrian@gmail.com
  Free signature tool.

<http://s.wisestamp.com/links?url=http%3A%2F%2Fr1.wisestamp.com%2Fr%2Flanding%3Fpromo%3D32%26dest%3Dhttp%253A%252F%252Fwww.wisestamp.com%252Femail-install%253Futm_source%253Dextension%2526utm_medium%253Demail%2526utm_campaign%253Dpromo_32&sn=>
CLICK
HERE TO GET 
IT.<http://s.wisestamp.com/links?url=http%3A%2F%2Fr1.wisestamp.com%2Fr%2Flanding%3Fpromo%3D32%26amp%3Bdest%3Dhttp%253A%252F%252Fwww.wisestamp.com%252Femail-install%253Futm_source%253Dextension%2526utm_medium%253Demail%2526utm_campaign%253Dpromo_32&sn=>
​


2013/8/5 Paolo Redaelli <paolo.redaelli@gmail.com>

> I liked Cyril idea on VARIANT and TYPED_VARIANT and I'm implementing it
> into database wrappers.
> Then I read gobject's G_VALUE discovering that GObject's variant would not
> fit in that design, as they have just one "polymorphic" class offering all
> kind of creation clauses.
> Of course the untyped parent/typed heirs fits better in a proper OO design
> as it's naturally extensible.
> Do you think it would be necessary to add several TYPED_VARIANT heirs to
> G_VALUE, such as G_STRING_VALUE (...) which are heirs of both
> TYPED_VARIANT[STRING], G_VALUE ?
>