Python component model

Edward Diener No Spam eldiener_no_spam_here at earthlink.net
Tue Oct 10 08:39:18 EDT 2006


Nick Vatamaniuc wrote:
> Edward Diener No Spam wrote:
>> Michael wrote:
> 
> Python does not _need_ a component model just as you don't _need_ a RAD
> IDE tool to write Python code. The reason for having a component model
> or a RAD IDE tool is to avoid writing a lot of boiler plate code.
> Python is terse enough that boiler plate code is not needed, just type
> what you need into an editor. It seems that you talk about Python but
> you are still thinking in Java or C++.

A RAD IDE tool to hook up components into an application or library ( 
module in Python ) has nothing to do with terseness and everything to do 
with ease of programming. All you are saying is that you don't have a 
need for this, but perhaps others do. I don't mind others saying they 
have no need or seeing no benefit. But if you have ever used a visual 
design-time environment for creating applications you might feel 
differently.

"Thinking in Java or C++" as opposed to Python does not mean anything to 
me as a general statement. I am well aware of the difference between 
statically and dynamically typed languages but why this should have 
anything to do with RAD programming is beyond me. Do you care to 
elucidate this distinction ?

> 
> At the same time one could claim that Python already has certain
> policies that makes it seem as if it has a component model. Take a look
> at the "magic methods". For example if a class has a __len__ method, it
> is possible to use the len() function on an instance of that class. If
> a class has the  __getitem__ then indexing can be used on that class's
> insance. Then Python has properties (see
> http://www.python.org/doc/2.2.3/whatsnew/sect-rellinks.html).  Just by
> inspecting the object one can tell a great deal about them (even read
> the documentation if needed, by using the __doc__ attribute).   What
> other standards would you propose for the core language?

Python has great facilities for a component model, much better than the 
other languages I use regularly ( C++, C#, Java ). I am not arguing 
against that. A component model for RAD tools allows the tool to expose 
properties and events to the end-user at design time so that at run-time 
the properties and events are automatically setup once an object is 
instantiated. The essence of a component model for RAD programming is 
how one specifies properties and events for a class to be manipulated by 
the RAD tool at design time. Another obvious part of the component model 
is how one specifies that the properties and events one sets up at 
design-time are serialized so that at run-time they are properly set. A 
final element of a component model is the ability of a component to 
interact with the environment in which it exists at design time, through 
property editors, and at run-time, the latter being obviously more 
important for visual controls than non-visual components.



More information about the Python-list mailing list