Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-03-04 11:27:48


"David Turner" <dkturner_at_[hidden]> writes:

> Hi
>
> Jesse Booher wrote:
>>
>>>>> dave_at_[hidden] 03/04/04 08:59AM >>>
>>> button("click me") doesn't have to be a widget. Think expression
>>> templates. It can just build up a type to be used by window to add a
>>> button.
>>
>> Well said. This exemplifies the reason why most gui toolkits are so
>> horrible to use, they allow implementation technicalities to dictate
>> interface. Having to decide where an object is going to live before any
>> of its properties can be set is a clear violation of object oriented
>> design principles but we live with these kind of problems all the time for
>> supposed technical reasons.
>
>
> Okay, you make a good point. On the other hand, I think that requiring
> child elements to have an explicit owner is good design; the problem is
> that the constructor syntax for widgets doesn't make it clear that they
> are in fact being constructed by the owning window.

You're still missing the point. The fact that the owning window
constructs the child is an implementation detail that has nothing to
do with the window structure/layout the user is trying to represent.
The syntax for describing a window should be declarative, not
imperative.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk