Python component model

Paul Boddie paul at boddie.org.uk
Tue Oct 10 07:23:08 EDT 2006


Edward Diener No Spam wrote:
>
> In the typical RAD development environment, a particular component model
> allows one to drop components, which are classes corresponding to a
> particular inner representation which tells the development environment
> what are the "properties" and "events" of that component, and
> subsequently set "properties" for that component and add handlers for
> its "events" visually.

As others may have mentioned, Python has its own built-in support for
properties: changing the state of an object with optional side-effects.
Moreover, as you realise, Python also has capable introspection
mechanisms to reveal such properties at run-time. However, things like
event mechanisms are not generally standardised.

[...]

> OK, I have proselytized enough <g>. Python is a great language and I
> truly love it and its flexibility and ease of programming use. If there
> is no impetus to create a component model for re-usable components for
> visual RAD environments in Python, that's fine with me. But I thought
> someone from the Python development community, given the use of visual
> RAD environments for other languages as mentioned above, to create GUI
> and large-scale applications, would have considered it.

You might want to look into environments and tools such as Qt Designer
together with PyQt. Whilst the PyQt mechanisms (really the Qt
mechanisms exposed in Python) aren't standardised as such, you get
event and property mechanisms which are actually quite powerful and
which certainly seem to demonstrate many of the RAD environment
capabilities you're interested in: you can write Python components
which can be dropped into the Designer environment and they're
responsive to introspection and interaction right there and then.

See this presentation for more details:

http://indico.cern.ch/contributionDisplay.py?contribId=33&sessionId=41&confId=44

Paul




More information about the Python-list mailing list