Extending C++ with Python scripting: "twin objects" or "proxyobjects"?

J

jdetaeye

Hi,

I would like to use Python as a scripting language for a C++ framework
I am working on.

The most common approach for this seems to be a "twin objects": the
python and the C++ object have the same lifespan and are always linked
to each other.
My initial thinking was to use a "proxy approach" instead: the python
object is only a temporary proxy object with a pointer to the real C++
object. The C++ object would live much longer than the proxy.

Is the proxy approach a valid alternative? I can't imagine it hasn't
been done before...
I am interested in hearing your experiences with it...

Currently I see the following + and -:
+ Easier for the C++ code (ie less changes, less coupling, no gc-
issues)
- Extending the framework through subclasses in Python is much harder
Anything else?

Regards,

Johan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top