I was looking at
the new tutorial on creating a title bar
and noticed that it uses layouts directly as component composites. This approach works when you’re set on using a specific layout, but it is rather counter-intuitive IMHO.
Is there a downside (other than writing about three lines of extra code) to using a CustomComponent instead and setting the layout as the composition root of the component? That way the layout can be changed on-the-fly without affecting the public interface of the component.
(The other advantage is a lot more subjective, but to me it feels more intuitive to create a custom component (which deals with its layout internally) than to create a layout and add some components to it.)