[webkit-dev] Clients and the Page constructor
darin at apple.com
Wed Jul 21 09:16:05 PDT 2010
On Jul 21, 2010, at 8:47 AM, Steve Block wrote:
> Currently, nine clients are passed to the Page constructor and the number is growing. Recently, clients have been added for Geolocation, DeviceOrientation and BackForwardController. This approach doesn't seem scalable.
What exactly does not scalable mean? Passing arguments to the constructor rather than setting them up later is often good because there is no time window where the object is not set up. Generally speaking we don’t want to have to write code to handle a client of 0 unless it’s absolutely necessary.
> Instead, the client should default to null and can be set with an explicit method call
Another option, if the objection is a function with a lot of arguments, is to pass in a structure with all the client pointers to the constructor.
What concrete problem are we trying to solve here? The words “doesn’t seem scalable” alone don’t make that clear to me.
More information about the webkit-dev