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

Discussion in 'Python' started by jdetaeye, Mar 18, 2008.

  1. jdetaeye

    jdetaeye Guest

    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
    jdetaeye, Mar 18, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron Stephens
    Replies:
    23
    Views:
    2,784
    Ron Stephens
    Apr 12, 2004
  2. Tommy Nordgren
    Replies:
    2
    Views:
    320
    Mike Meyer
    Apr 21, 2005
  3. DaveInSidney
    Replies:
    0
    Views:
    396
    DaveInSidney
    May 9, 2005
  4. Johannes Zellner
    Replies:
    1
    Views:
    329
    Fredrik Lundh
    Jan 18, 2006
  5. Kiran
    Replies:
    5
    Views:
    282
    Kiran
    Oct 26, 2006
Loading...

Share This Page