On Mon, Nov 2, 2009 at 3:37 PM, Bradley Nelson <bradnel...@google.com>wrote:

> S,o as it happens, I just had someone on nacl make the first use of
> multiple inheritance this morning.
> He hasn't checked it in yet, but the use case is:
>
> 'Common': {
>   # bunch of global stuff
>   'defines': [
>     # bunch of 32-bit defines.
>   ],
> },
> 'Debug': {
>   # bunch of general debug stuff assumes 32-bit
>   'inherit_from': ['Common'],
> },
> 'Release': {
>   # bunch of general release stuff assumes 32-bit
>   'inherit_from': ['Common'],
> },
> 'Common_x64': {
>   # Customizations to change 32-bit -> 64-bit
>   'abstract': 1,
>   'defines!': [
>     # bunch of 32-bit defines
>   ],
>   'defines': [
>      # bunch of 64-bit defines
>   ],
> },
> 'Debug_x64': {
>   'inherit_from': ['Debug', 'Common_x64'],
> },
> 'Release_x64': {
>   'inherit_from': ['Release', 'Common_x64'],
> },
>
> This use case seems reasonable enough.
> It might fit into something like (b), but at least as currently conceived,
> 'Common_x64' has overrides of stuff in 'Common'.
> It might be possible to refactor Common and Common_x64 to avoid collisions,
> maybe pull out all the 32-bit stuff into Common_x86 and leave Common with
> truly common stuff. On the other hand, the current arrangement allowed a
> fairly small modification while 64-bit is being experimented with.
> Suggestions?
>

Sorry for the slow response to this...missed it in my inbox. :(

It's hard to see w/o a concrete example, but in general I would have wanted
to do it via conditionals inside 'Common.'

Why rely on shadowing when you can explicitly do it via conditionals here?

IMO, the more dimensions in which we have to alter how the final dictionary
is created, the harder it will be to maintain -- especially if there
construct is one which relies on order of lookup, and doesn't encourage
co-locating where the decision is made for which modifications are included
(with conditionals, you know the "else" portion is likely in the same file.
 With inheritance, it's all over the place.)

-Albert

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to