On Tue, Aug 2, 2011 at 1:27 AM, Roland Steiner <[email protected]> wrote:
> On Tue, Aug 2, 2011 at 4:36 PM, Jonas Sicking <[email protected]> wrote:
>> This doesn't explain why a factory method is better than explicit
>> constructors though? The above could be written as
>>
>> new HTMLParagraphElement(null, "foo", ...);
>
> It's not a general use case, but at least when it comes to XBL-like
> components, having a factory method that does all the lookup and
> binding behing the scenes probably is easier to implement than hooking
> a constructor (FWIW).

I am not sure it will be easier but it does seem that it would be more
natural to an author to write:

var foo = new FooButton();

than:

var foo = Element.create('x-foo-button').

:DG<

Reply via email to