Signals and Slots in D

Fredrik Olsson peylow at gmail.com
Fri Sep 29 01:19:49 PDT 2006


Bill Baxter skrev:
<snip>
> Also it means that at run-time, you can safely try to connect to slots 
> that may or may not be there.  If the target doesn't have that slot, no 
> harm done.  And you don't need to know anything about the object at 
> compile time other than it's a QObject.  Loose coupling.
> 
Loose coupling also means that you can easily make a GUI in say some 
kind of XML-file. In this file the interface is defined, along with it's 
connections. A object schema if you like. But then you would need to be 
able to pass around classes, like in Object Pascal:
SomeClass createAndInit(SomeClass& aClass) {
   SomeClass foo = new aClass();
   foo.doComplexStuff();
   return foo;
}

Heaven sent for tools. Having an UI tool that manipulates a XML-file is 
way better than an UI tool that creates and modifies actual code. 
Especially when the user comes and modifies this code by hand later. And 
having localization in retargetable text files is just genius.

Hmm... writing a new UI framework, is that a smart idea? There are 
already dozens.


// Fredrik Olsson



More information about the Digitalmars-d mailing list