On Jun 17, 2010, at 12:50 PM, Maciej Stachowiak wrote:
>
> On Jun 17, 2010, at 11:26 AM, Geoffrey Garen wrote:
>
>>> I propose that we create an abstract class, "PlatformMechanism" which acts
>>> as the starting point for accessing such functionality, something like:
>>>
>>> class PlatformMechanism {
>>> virtual ClipboardMechanism* clipboardMechanism() = 0;
>>> virtual FileAccessMechanism* fileAccessMechanism() = 0;
>>> virtual PluginMechanism* pluginMechanism() = 0;
>>> };
>>
>> I think this would read better if you just got rid of the "Mechanism"
>> suffix. It's such an abstract word that it's maybe meaningless.
>>
>> You might still need something to distinguish this kind of clipboard from,
>> say, the WebCore clipboard. For that, I suggest using the word "platform."
>
> I agree that Mechanism is a very vague word. Platform is an interesting idea,
> but I believe it is potentially confusing in some ways. We have normally used
> platform/ to refer to stuff in the Platform directory. In fact we already
> have a Clipboard class in WebCore/platform, the role of which is platform
> abstraction of the underlying implementation. The proposed PlatformClipboard
> object would not primarily be providing platform abstraction, rather its main
> role is to provide runtime switchability among different implementations, one
> of which is a cross-process proxy and the other of which implements clipboard
> functionality directly. I don't think the name PlatformClipboard clearly
> identifies how the role is different from Clipboard, given the context of the
> project.
>
> Cracking my Design Patterns book (or at least my memory of it), another idea
> that comes up is "Strategy". Strategy is a design pattern where you have a
> runtime switchable object that provides alternative approaches to providing
> the same functionality. Then we would have:
>
I like Strategy, it's a bit less vague and it actually reflects the design
pattern that we are using here. I'll go with that for now!
(I suppose the "PlatformMechanism" class would then become
"PlatformStrategies"...)
- Anders
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev