About complexity of XOTcl.
Many of XOTcl features are only interesting for special scenarios such as OO-frameworks or wrapping techniques.
For OO-Beginners these XOTcl-Features might be not interesting: - method forwarding - filters - meta classes - slots - mixins - assertions, pre/post condition - non positional arguments - object aggregation I have ordered the features from most advenced to quite practical in my opionion.
Although I have written many lines of XOTcl code I have rare used filters (only for debugging and IDE features) and never method forwarding. I have also never implemented my own meta class. Mixins can be practical to avoid big class hierarchies or in some special object lifecycle scenarios. But I need some times to figure out when to use mixins. Object aggregation is very usefull.
Also antother OO-Languages have some such specials features. Examples for Java: - anonym classes - generics - dynamic proxy - reflection - interfaces - abstract classes
So you can use successful XOTcl without understanding some of its features. The practical advice is to start with XOTcl and learn some additional features only If you feel you need it.
I think that it is historical reason that in XOTcl tutorials there is strong focus on new features of OO. The authors wanted to describe new innovations for known problems in OO. But these problems of OO are apparent only in bigger OO-Project and can be understood only by experienced OO-Programmers. XOTcl has academic background, so the innovations are quite important. But in comparison with another academic project it is practical usable for industry needs and standards.
On the other hand features like filters and mixins can be very useful to modify or extend system without to complete redesign it. It helps to modify the system dynamically. But you will never have such problems at the beginning of the project or by small projects. So you will probably appreciate XOTcl in cases when other OO-Systems will let you down.
I use many OO-languages professional like: Java, C++, C# but some additional features of XOTcl, which I miss by Java and C#, and some base characteristic of Tcl are for me perhaps the only reason why I still use XOTcl/Tcl.
Artur Trzewik
mail@xdobry.de schrieb:
For OO-Beginners these XOTcl-Features might be not interesting:
- method forwarding
- filters
- meta classes
- slots
- mixins
- assertions, pre/post condition
- non positional arguments
- object aggregation
I have ordered the features from most advenced to quite practical in my opionion.
Although I have written many lines of XOTcl code I have rare used filters (only for debugging and IDE features) and never method forwarding. I have also never implemented my own meta class. Mixins can be practical to avoid big class hierarchies or in some special object lifecycle scenarios. But I need some times to figure out when to use mixins. Object aggregation is very usefull.
artur,
this is an interesting point of view. I have made often made the observation that - given the power of xotcl - beginners tend to "shoot with canons to sparrots" (as we se in German). Using all language features for every tiny problem is not necessarily the best approach.
Your list of what's important is certainly based on your experience and your needs. It would be interesting to make a little program analyser for arbitrary scripts, which outputs some basic metrics from existing programs (starting with LOC, but as well #of classes, methods, forwards, filters ...). This should not be very complicated, the basic framework can be implemened purely with mixins (for proc, instproc, class, superclass, forward, mixin, ...). Sounds like a nice weekend project.
-gustaf neumann
Many of XOTcl features are only interesting for special scenarios such as OO-frameworks or wrapping techniques.
For OO-Beginners these XOTcl-Features might be not interesting:
- method forwarding
- filters
- meta classes
- slots
- mixins
- assertions, pre/post condition
- non positional arguments
- object aggregation
I have ordered the features from most advenced to quite practical in my opionion.
Method forwarding (aka delegation) is an absolute must and common feature for megawidget development (fwiw).
Jeff
Jeff Hobbs schrieb:
Many of XOTcl features are only interesting for special scenarios such as OO-frameworks or wrapping techniques.
For OO-Beginners these XOTcl-Features might be not interesting:
- method forwarding
- filters
- meta classes
- slots
- mixins
- assertions, pre/post condition
- non positional arguments
- object aggregation
I have ordered the features from most advenced to quite practical in my opionion.
Method forwarding (aka delegation) is an absolute must and common feature for megawidget development (fwiw).
Yes. But there is a difference between megawidget developer and developer who only use magawidget. For using megawideg you do need to now nothing about internals of it. Not everyone must be Tcl guru for using it.
Artur Trzewik
Artur Trzewik wrote:
Jeff Hobbs schrieb:
Many of XOTcl features are only interesting for special scenarios such as OO-frameworks or wrapping techniques.
For OO-Beginners these XOTcl-Features might be not interesting:
- method forwarding
- filters
- meta classes
- slots
- mixins
- assertions, pre/post condition
- non positional arguments
- object aggregation
I have ordered the features from most advenced to quite practical in my opionion.
Method forwarding (aka delegation) is an absolute must and common feature for megawidget development (fwiw).
Yes. But there is a difference between megawidget developer and developer who only use magawidget. For using megawideg you do need to now nothing about internals of it. Not everyone must be Tcl guru for using it.
It is true that there are always going to be more megawidget users than authors, but don't underestimate the potential "developer base" of megawidget authors. Look at how many systems and megawidgets others have developed. On top of each of these (bwidgets, iwidgets, etc), developers have created their own variations to solve problem need.
In fact, the only reason this hasn't been more commonplace is due in large part to the lack of an accepted megawidget framework in Tk. I had hoped to have one on top of the 8.5 OO, but that is deferred.
The need to customize minor variations of widgets is quite common for almost any size of Tk app. Text widgets with readonly sections, entry widgets that have special validation behaviors, comboboxes with hotlists and other fancy features, ... Do not underestimate the importance of having *strong* megawidget framework support in the core OO.
Jeff