You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2006/12/06 15:02:11 UTC

[c++] Help Reqruied - PHP SCA extension for C++ SCA

As one of the maintainers of the SCA_SDO PECL project I've naturally started
thinking about how we build a PHP extension for the C++ SCA runtime based on
the PHP SCA implementation we have recently released (
http://pecl.php.net/package/sca_sdo). I'm cross posting this as it involves
both Tuscany and the SCA_SDO pecl project.

You may have noticed that the C++ SCA codebase already has a PHP extension
of sorts. I have just brought this back to life using a new VCExpress
makefile and using PHP 5.2.0 GA. The patch for these changes is in
http://issues.apache.org/jira/browse/TUSCANY-974.

The current extension is very limited and it would be interesting to see if
we can make the PHP SCA implementation run inside the C++ container. This
means quite a few changes to what's there already in the C++ SCA PHP
extension.  To date I have read though  a lot of the PHP and C++ SCA source
code to try and learn what's going on. I made some very high level notes on
what I thought was important as I went through (
http://www.osoa.org/display/PHP/PHP+SCA+Extension+For+Tuscany+C+++SCA). What
I have written may not be 100% true so I'm keen to find out from the experts
where the holes are. You will see I have started to make a list of the
things to be done. This is high level at the moment....


   1. Embedding PHP - improve the PHP Embedding SAPI use in the PHP
   extension
      1. There is currently a memory deallocation SEGV. I have
      commented out the clean up to avoid it at present
      2. Only primitive types are handled
      3. Needs to align with PHP SCA infrastructure - need an new
      wrapper of some form in PHP
      4. Need to decide if we are going to support PHP
      SCA/Scripts/Functions/Class members as options
   2. Meta Data Exchange
      1. Mechanism/protocol for extracting data from the PHP SCA
      annotation based model.
      2. Need an extension to the C++ SCA model implementation to
      allow for it to be dynamically extended with information from PHP SCA
      3. At some point we may want to pass meta data from the C++
      model to the PHP model
      4. We also need to tidy the PHP SCA model to make it more
      efficient and easier to use
   3. Reference implementation
      1. Implement a new proxy to take calls from PHP, through PHP
      extension code and into the right place in C++ SCA
      2. Need a mechanism to find the right proxy in C++ SCA to call.
      Look at how Python/Ruby extensions do this
   4. Bindings and Data bindings - not explicitly on the previous
   diagrams but...
      1. Known to require improvement in PHP SCA. We need simple
      pluggable approach so that we can easily add new bindings. This will, at
      some point, have an impact on how we tie C++ and PHP SCA together
      2. In C++ the data binding picture is currently in flux and so
      this will also have an impact on this work


This list will grow as we learn more so feel free to make comments. Also If
anyone fancies having a look at any of these tasks then please make a
suggestion. I'm afraid the web site link I gave above is not publically
writeable but I'll update it form any conversation that happens here. Or, if
you feel you need to go and update it directly, suggest somewhere else where
we can put the information.

It think we can approach this problem in stages. i.e. we don't necessarily
have to do everything up front, although we do need to do a few things to
get going. In my mind the initial pieces of work involve:

1.1
1.3
2.1
2.2

Shortly followed by 3.1 and  3.2.

Over the next couple of days I am going to start looking at 2.1 directly and
I'll need some help with 2.2. (which has to work together with 2.1).

Regards

Simon