On Tue, Nov 15, 2011 at 12:33 PM, Vitaly Repeshko <[email protected]>wrote:

> On Tue, Nov 15, 2011 at 12:19 PM, Dmitry Lomov <[email protected]> wrote:
> >
> >
> > On Tue, Nov 15, 2011 at 10:59 AM, Vitaly Repeshko <[email protected]>
> > wrote:
> >>
> >> >> http://codereview.chromium.org/8536042/diff/1/src/api.h
> >> >> File src/api.h (right):
> >> >
> >> >> http://codereview.chromium.org/8536042/diff/1/src/api.h#newcode164
> >> >> src/api.h:164: class ExtensionStates : private HashMap {
> >> >> Use delegation instead of implementation inheritance.
> >> >
> >> > All other uses of HashMap in V8 use implementation inheritance.
> >>
> >> This is not true, BTW, but that's not the point. I think we should try
> >> to improve the code where we can and especially when it's easy to do
> >> so.
> >
> > Ok. I think _private_ inheritance versus delegation is really more of a
> > religious question than a true "improvement".
> > I don't feel strongly either way, if you do I can change that easily :)
>
> Haven't I made it clear how strongly I feel about it? :)
>
> Private inheritance is a closer relationship than delegation (you see
> the base's protected stuff and can override the virtual functions).
> It's nice to avoid close relationships when they are not necessary.
>

Right, I do understand those issues - I do not feel they are critical for a
simple hashmap wrapper so my guidance was other code in the project.
(in fact I had it your way first and then changed to private inheritance
for consistency with other uses of Hashmap in V8)
Anyway I'll do what you (so strongly) suggest :)
If I may venture a suggestion, it will be good to go over V8 code and get
rid of "implementation exposure driven" inheritance throughout.


>
>
> Thanks,
> Vitaly
>

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to