Python declarative

Frank Millman frank at chagford.com
Fri Jan 24 07:49:16 EST 2014


"Chris Angelico" <rosuav at gmail.com> wrote in message 
news:CAPTjJmo+EuY439wB0C8or+ZAcYeNR844HAKwL3i2+55dDE8LNA at mail.gmail.com...
> On Fri, Jan 24, 2014 at 8:21 PM, Frank Millman <frank at chagford.com> wrote:
>> I find that I am using JSON and XML more and more in my project, so I
>> thought I would explain what I am doing to see if others think this is an
>> acceptable approach or if I have taken a wrong turn.
>
> Please don't take this the wrong way, but the uses of JSON and XML
> that you describe are still completely inappropriate. Python does not
> need this sort of thing.
>

Chris, I really am very grateful for your detailed response. There is much 
food for thought there and I will have to read it a few times to glean as 
much as possible from it.

Here are some initial thoughts.

1. I don't really understand how your system actually works! You mention 
Python code and helper functions, but I cannot picture the overall structure 
of the program. I don't know if it is possible to provide a siimple example, 
but it would certainly help.

2. I am not sure if you have created this to make it easy for *you* to 
create forms, or for others. And if the latter, must they be programmers? 
One of my goals is to allow non-programmers to modify forms and even create 
them from scratch. I did mention that one benefit of my approach is that I 
can design a gui that allows this, but I don't get the sense that your's 
does.

3. Thanks for the links to the Inner Platform Effect. I had not heard of it, 
but I recognise the symptoms, and I realise that I am skirting close to it 
in some areas.

4. You are right that some things cannot be totally abstracted, and can only 
be handled by code. My approach is as follows. If at least 80% of the 
structure can be handled without resorting to code, I think it is 
worthwhile, and I think I have more than achieved that. Of the balance, if 
at least 80% of requirements are 'standard', I can write the standard 
functions in Python, and create an XML tag that will cause the function to 
be invoked at run-time. The 'designer' still does not have to worry about 
Python. For the remainder, I have created an XML tag called 'pyfunc' that 
provides a path to a custom-written function. For this, a Python programmer 
will be required. So far I have only made use of this in my 'form designer', 
which is quite complex as it has to take the XML definition and 'explode' it 
into a number of in-memory tables so that it can be presented in gui form. 
However, the average user is not going to get their hands that dirty.

Thanks again

Frank






More information about the Python-list mailing list