Re: [Zope3-Users] ZCML debugger?

2006-02-14 Thread Stephan Richter
On Monday 13 February 2006 17:06, Roman Susi wrote:
 If I compare this situation to Python, it is always quite
 straightforward to look at the source of the module or to
 help(thesamemodule) to see that I need first make an instance of some
 class and then use its methods.

 So, probably, Zope3 needs a kind of a tour which explains those links
 which are not explicitely visible.

Python is a programming language with some libraries not a framework. The big 
challenge of a framework is to be pluggable. So Zope 3 is ultra-pluggable. 
The downside that arises is that you cannot document a set of features in a 
straight-forward manner. And again, you cannot expect to understand a 
framework from API documentation. This is even true for Python; if you want 
to understand on what's really going on, you have to read some real 
documentation.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] ZCML debugger?

2006-02-13 Thread Roman Susi
Stephan Richter wrote:
 On Sunday 12 February 2006 10:19, Roman Susi wrote:
 
Could it be beneficial to have some kind of wizard which could help
write ZCML configurations?
 
 
 Sure. I think a lot of people would be happy about a tool like that. The way 
 ZCML is constructed should make it very easy to retrieve all needed 
 information, build RelaxNG schemas, etc.

Lets hope someone will scratch the itch...

Or at least some good documentation on what is the meaning of ZCML
constructs.
 
 
 Have you looked at http://localhost:8080/++apidoc++;? It contains a 
 dynamically generated ZCML documentation section. If you think that this 
 facility is not well-organized you could easily contribute improvements 
 there.

Sure, I know about this. But I can't right away tell what is wrong
there. Maybe, reading/writing ZCML requires more experience. That is, if
you see (or think about) some definition and then write ZCML code right
from the head... With Python the way from needed semantic to syntax is
more direct... And I remember it was from the first day I learned Python...

Not that I claim Python could be better for ZCML task, but maybe some
wizard like thing is needed to help learn it. I am not sure. Sorry, I
have not some up with anything constructive yet.

 - what is the purpose of declaration (for example, what is the purpose
of declaring that OFS.Folder.Folder is traversable?) (that is, pragmatics)
 
 
 Note: This is a five directive, not a native Zope 3 one.

Yes. Most frustration comes from Zope 2/Five where broken configure.zcml
are silently ignored... So, the real question is:

 - is there any way in Zope2/Five and/or Zope 3 to check zcml for
obvious errors?

 - what is needed to be declared (and where) to achieve certain typical
goals (like: in order to implement View class to this Content classes,
you need to add this to ZCML configure)
 
 Books are for that. Both Philipp and my book explain what directives you need 
 in the situations presented.

Yes, certainly. I have not yet tried to read paper books.

Also, someone noted that write-once principle is broken with ZCML: it's
very verbose to at least my taste.
 
 
 It is not really more verbose than Python.

I think, it is: it requires to repeat the same (sometimes long) things like:

.thispackage.browser.thatview

and doesn't give visual picture what is adopted to what. It's like
assembler:

 LOAD A
 LOAD B
 ADD A, B
 STORE C

instead of

 C = A+B

or even

 C = ADD(A, B)

And after ABC of ZCML there lay a layer of idioms, unspoken patterns, etc.
 
 
 Can you elaborate? I do not understand what you mean.

I mean that when there are many ways to do the same, idioms are invented.

For example, what is better way to include browser's subdir
configure.zcml: by include package or include file?

My little experience tells me that file include (while it makes some
names longer) is more explicit, because I can use classes from the
Content directory (usually up the path).

That is,

 - mypackage
   + - browser
   +   \configure.zcml  - here I can use .mymodule if it is included as
file
   + mymodule.py
   \ configure.zcml

But the point is, there are at least 2 ways. And there are also, it
seems, idiomatic meanings of meta.zcml (not sure what is the difference
as technically they are the same as configure.zcml), etc.

So, lot of knowledge also is hidden in the practice of writing things
some way. And it is not always self-evident where I see some idiom or
required way to describe things.

 Regards,
 Stephan

Sincerely yours,
Roman
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] ZCML debugger?

2006-02-12 Thread Roman Susi

Hi!

After having fight with ZCML I think some sort of debugger, checker, 
validator or wizard is needed to help writing ZCML!
Trial-and-error approach is too costly and frustrating to newbies. 
Discovering what goes where or from where is nightmare and error-prone too.
Zope3 already has a good doc system, based on ZCML and source code 
information (if I am not mistaken).
Could it be beneficial to have some kind of wizard which could help 
write ZCML configurations?


Or at least some good documentation on what is the meaning of ZCML 
constructs.

Declarative approach is good if one know:

- what is the purpose of declaration (for example, what is the purpose 
of declaring that OFS.Folder.Folder is traversable?) (that is, pragmatics)
- what is needed to be declared (and where) to achieve certain typical 
goals (like: in order to implement View class to this Content classes, 
you need to add this to ZCML configure)


Of course, this misunderstanding will go away with experience. But I 
think this is what really frustrates newbies.
Even programming language source code (especially imperative) is easier 
to understand: it can be followed. Object-oriented systems are less 
navigable, but still it is possible.

Now, the ZCML declarations seem to hang in the air...

Also, someone noted that write-once principle is broken with ZCML: it's 
very verbose to at least my taste.


And after ABC of ZCML there lay a layer of idioms, unspoken patterns, etc.

Regards,
Roman
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users