Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] propel / c++

propel
Discussion topic

Back to topic list

Re: [propel-dev] propel / c++

Reply

Author Roel Vanhout <roel dot vanhout at gmail dot com>
Full name Roel Vanhout <roel dot vanhout at gmail dot com>
Date 2006-07-24 08:32:59 PDT
Message Looks like this requires deeper changes than I originally thought (no
surprise there).

It's easy to make PHPObjectBuilder and put the php-specific things in
there. However, in order to let the other classes derive from that
PHPObjectBuilder, we'd need something like this (I originally thought
it would work but it doesn't):

class PHP5BasicObjectBuilder extends
DataModelBuilder::bu​ilderFactory(null, 'ombuilder') {
}

Then we'd just add another key to the propertiesfile and off we go.
But as I said, it looks like inheriting from anything but a 'static'
type is impossible.

Next option is to recreate the OMBuilder, ObjectBuilder and
PeerBuilder in the language-specific directorie and have them derive
from the language-neutral classes (to avoid duplicating code). This is
fine for OMBuilder (I wrote a PHPOMBuilder that derives from OMBuilder
and let all classes that originally derived from OMBuilder derive from
PHPOMBuilder.) But for PeerBuilder, that doesn't work because
PeerBuilder itself derives from OMBuilder, whereas it should derive
from PHPOMBuilder, or CPPOMBuilder, as required. The alternative is to
move the code from PeerBuilder to PHPPeerBuilder, but that same code
would have to be duplicated in CPPPeerBuilder, which is not good.
In C++ I'd solve this with either multiple inheritance to pull in the
common functionality from a shared base class or with templates to let
PeerBuilder be templated to provide the base class, but it seems that
MI and templates aren't available in PHP without nasty hacks. I'm not
quite sure what to do at this point, I'll think it over, but if anyone
who is more familiar with the codebase has an idea, feel free to take
a look yourself :)

cheers,

roel


On 7/24/06, Roel Vanhout <roel dot vanhout at gmail dot com> wrote:
> I'll look into making a patch, but I'd rather not commit it myself - I
> got yelled at once in another project a couple of years ago, now I'm a
> bit hesitant to commit to codebases I'm not very familiar with :) I'll
> let the list know. Thanks.
>
> cheers,
>
> roel
>
>
> On 7/24/06, Hans Lellelid <hans at velum dot net> wrote:
> > Hi Roel,
> >
> > I think we just need to change that behavior. Perhaps we should make a
> > PHPOMBuilder subclass that holds any PHP specific stuff. I'll see if I
> > can find a few minutes to look at that today. (Or, if you'd like to
> > refactor that class, you can send me an email w/ username request for
> > SVN and I'll make you an account.)
> >
> > Cheers,
> > Hans
> >
> > Roel Vanhout wrote:
> > > Hello Soenke,
> > >
> > > Thanks for your answer, this works for all classes that are in the
> > > propel\generator\c​lasses\propel\engi​ne\builder\om\php​5 directory but
> > > there is one file (OMBuilder.php) that is one directory higher. I
> > > don't see it mentioned in the default.properties list of builders. In
> > > this file, which defines the OMBuilder class, the <?php is added to
> > > every file that is written out and it sets .cpp as extention for files
> > > that are written, both of which I'd like to change. I don't see
> > > however where I can indicate that my custom class should be used.
> > >
> > > cheers,
> > >
> > > roel
> > >
> > >
> > > On 7/24/06, Soenke Ruempler <ruempler@topconc​epts.com> wrote:
> > >> Roel Vanhout <mailto:roel.vanh​out at gmail dot com> wrote on Monday, July 24,
> > >> 2006 12:50 PM:
> > >>
> > >> > I'm not sure if that was directed at the PECL thing or the pure C++
> > >> > that I'm trying to accomplish :) , but either way: is there anyone who
> > >> > knows the answer to my original question whether it is possible to use
> > >> > another OMBuilder class? Thanks.
> > >>
> > >> Of course, in build.properties we have it like this:
> > >>
> > >> propel.builder.mapbuilder.class = tcc.Propel.Engine.Builder.Map
> > >> propel.builder.object.class =tcc.Propel.Engine.B​uilder.ComplexObject​
> > >> propel.builder.peer.class =tcs.Propel.Engine.B​uilder.ComplexPeer
> > >>
> > >> -soenke
> > >>
> > >> --------------------​--------------------​--------------------​---------
> > >> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> > >> For additional commands, e-mail: dev-help at propel dot tigris dot org
> > >>
> > >>
> > >
> > > --------------------​--------------------​--------------------​---------
> > > To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> > > For additional commands, e-mail: dev-help at propel dot tigris dot org
> > >
> >
> > --------------------​--------------------​--------------------​---------
> > To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> > For additional commands, e-mail: dev-help at propel dot tigris dot org
> >
> >
>

« Previous message in topic | 18 of 18 | Next message in topic »

Messages

Show all messages in topic

propel / c++ Roel Vanhout <roel dot vanhout at gmail dot com> Roel Vanhout <roel dot vanhout at gmail dot com> 2006-07-21 09:11:01 PDT
     Re: [propel-dev] propel / c++ Pedram Nimreezi <zenstyle at gmail dot com> Pedram Nimreezi <zenstyle at gmail dot com> 2006-07-21 09:30:52 PDT
         Re: [propel-dev] propel / c++ Roel Vanhout <roel dot vanhout at gmail dot com> Roel Vanhout <roel dot vanhout at gmail dot com> 2006-07-21 09:41:38 PDT
             Re: [propel-dev] propel / c++ Pedram Nimreezi <zenstyle at gmail dot com> Pedram Nimreezi <zenstyle at gmail dot com> 2006-07-22 08:11:08 PDT
                 Re: [propel-dev] propel / c++ Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-07-22 08:34:07 PDT
                     Re: [propel-dev] propel / c++ Pedram Nimreezi <zenstyle at gmail dot com> Pedram Nimreezi <zenstyle at gmail dot com> 2006-07-22 09:39:42 PDT
                         Re: [propel-dev] propel / c++ Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-07-22 09:57:10 PDT
                             Re: [propel-dev] propel / c++ Pedram Nimreezi <zenstyle at gmail dot com> Pedram Nimreezi <zenstyle at gmail dot com> 2006-07-22 10:49:06 PDT
                                 Re: [propel-dev] propel / c++ Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-07-22 12:13:38 PDT
                                     Re: [propel-dev] propel / c++ Pedram Nimreezi <zenstyle at gmail dot com> Pedram Nimreezi <zenstyle at gmail dot com> 2006-07-22 13:28:27 PDT
                         RE: [propel-dev] propel / c++ Soenke Ruempler <ruempler at topconcepts dot com> Soenke Ruempler <ruempler at topconcepts dot com> 2006-07-24 03:11:41 PDT
                             Re: [propel-dev] propel / c++ Roel Vanhout <roel dot vanhout at gmail dot com> Roel Vanhout <roel dot vanhout at gmail dot com> 2006-07-24 03:49:34 PDT
                                 RE: [propel-dev] propel / c++ Soenke Ruempler <ruempler at topconcepts dot com> Soenke Ruempler <ruempler at topconcepts dot com> 2006-07-24 04:07:02 PDT
                                     Re: [propel-dev] propel / c++ Roel Vanhout <roel dot vanhout at gmail dot com> Roel Vanhout <roel dot vanhout at gmail dot com> 2006-07-24 04:17:38 PDT
                                         Re: [propel-dev] propel / c++ hlellelid Hans Lellelid 2006-07-24 05:29:07 PDT
                                             Re: [propel-dev] propel / c++ Roel Vanhout <roel dot vanhout at gmail dot com> Roel Vanhout <roel dot vanhout at gmail dot com> 2006-07-24 06:19:26 PDT
                                                 Re: [propel-dev] propel / c++ hlellelid Hans Lellelid 2006-07-24 06:20:06 PDT
                                                 Re: [propel-dev] propel / c++ Roel Vanhout <roel dot vanhout at gmail dot com> Roel Vanhout <roel dot vanhout at gmail dot com> 2006-07-24 08:32:59 PDT
Messages per page: