473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Automatic Code Generation


Someone raised the question of automatic code generation a few weeks back.

And yes, we (CCPN) are using automatic Python code generation in a major
way. Basically we are making data models in UML, and using automatic code
generation to make Python APIs, XML I/O etc. (more below). We can be found
at http://www.ccpn.ac.uk/index.html

As a general point, automtic code generation would seem like a good idea
in special cases where:

- a lot of repetitive code can be derived completely from a more compact
or problem-oriented description.
- The problem is large
- You need to keep doing new pieces of code and/or maintain several sets
of synchronized files on top of an evolving problem description
- You avoid hand-modifying the code, either because you can get 100%
automatic generation, or you can 'park' the handcoded modifications where
they are read into the automatic generation process.

Yours,

Rasmus

================================================== ========================

In case you are interested, here are some details:

We work on data models for domain-specific data storage and interchange,
making precise data specifications, libraries, XML specifications, etc.
The UML model specifies the classes, attributes and links that describe
the data. We then generate Python classes with properties and access
functions, XML mappings and schemas. We generate Python APIs and XML
storage, and are working on extending to Java and relational databases (in
progress) and C and C++ APIs (planned). All the code generation is done
with Python scripts, of course.

So far, we have:

277 classes and 2006 attributes in the data model

316000 lines of Python (mostly autogenerated) and
527000 lines of HTML documentation (mostly autogenrated)

Better than 98% autogeneration for the API.

Because we need to guarantee that data stored in the model are consistent
and conform to specifications, our Python functions check data type (yes,
we had to), arbitrarily specified constraints, data consistency, data
encapsulation, and supports notifiers so that e.g. GUIs can be notified
when underlying data change.

---------------------------------------------------------------------------
Dr. Rasmus H. Fogh Email: r.******@bioc.cam.ac.uk
Dept. of Biochemistry, University of Cambridge,
80 Tennis Court Road, Cambridge CB2 1GA, UK. FAX (01223)766002


Jul 18 '05 #1
0 2415

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Kannan Goundan | last post by:
Maintaining a C++ header file can be painful. I want a way to automatically generate header files from the implementation file. Does anybody know of a program that does this? If not, I'd like...
5
by: Abhishek Srivastava | last post by:
Hello All, There is a particular feature which I want to have in visual studio .net suppose I create a class ClassA { private string name; private int age;
4
by: Petterson Mikael | last post by:
Hi, Anyone out there that knows of a automatic test generation tool for cpp? Another requirement is that the test results should be presented in xml. All hints appreciated. cheers, ...
1
by: woessner | last post by:
I have a lot of classes which derive from a common base class. I want to be able to clone objects of these types so I have given the base class a pure virtual clone method. The derived classes...
0
by: JoshforRefugee | last post by:
heard that we can do automatic code generation using macros, but not sure how can I pursue this. Here is my problem. In my env, I have class A,B and C. All of them has constructors, and few...
0
by: adeebraza | last post by:
Hi Every Body The following is the code for generation of 1/100 of a seconds Time and used Them for recording of a Race time for five Track on a ground. Option Explicit DIM, C,M,S Private...
9
by: puzzlecracker | last post by:
From my understanding, if you declare any sort of constructors, (excluding copy ctor), the default will not be included by default. Is this correct? class Foo{ public: Foo(int); // no...
25
by: sidd | last post by:
In the following code: int i = 5; ---it goes to .data segment int j; ---it goes to bss segment int main() { int c; int i = 5; ---stack
34
by: =?ISO-8859-1?Q?Marcel_M=FCller?= | last post by:
Hi, is there a way to avoid the automatic copy constructor generation. I do not want the object to be non-copyable. I simply do not want that copying is done by the default copy constructor. But...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.