hacfi/ObjectBridgeBundle

the name doctrine bridge is already taken

Opened this issue · 14 comments

dbu commented

sorry, one more thing i notice is that we have a name clash. there is https://github.com/symfony/DoctrineBridge which has the purpose of bridging doctrine into symfony. its a really different type of bridge. but i think we should find a different name to make this work. what about DoctrineInterlinkBundle or DoctrineConnectorBundle?

/cc @sjopet

btw, as this is supposed to eventually go into the doctrine project, why not use the doctrine namespace even now? would make it easier to migrate.

yes I agree. If this is going to be a doctrine bundle, which would make sense, why not create it in the doctrine namespace. I still think BridgeBundle is a good name though. I hope @markri who wrote our initial version would like to have a look.

dbu commented

i like the BridgeBundle name, it sounds right. the only issue is that
its confusing with the doctrine bridge of symfony that is something
different.
btw, would it make sense to have a Brigde|Interlink|whatever library
that can be used outside of symfony, and the bundle just leveraging that
library?

@dbu I’ll change it to doctrine namespace when I rename the bundle later today.

More suggestions:

  • ObjectBridgeBundle
  • MapperBridgeBundle

I also link the Interlink part.

I don’t care much about the name although I think DoctrineConnectorBundle sounds to generic (could be a bundle to connect DBAL or something).

dbu commented

i like ObjectBridgeBundle

ObjectBridgeBundle or ModelBridgeBundle??

After reading the README, the following names come to my mind:

  • DoctrineRelationBundle
  • DoctrineReferenceBundle
  • EntityRelationBundle
  • EntityReferenceBundle
  • ModelRelationBundle
  • ModelReferenceBundle
stof commented

FYI, OpenSky contributed their Doctrine extension doing such stuff into the Gedmo extensions a while ago as it is not specific to Symfony (there is no support for referencing an ORM entity inside a PHPCR document yet but it is a matter of writing 1 class. the opposite is already possible)

Thanks for the suggestions @dbu, @sjopet & @GromNaN !

@stof I checked out the Gedmo reference extension when I started working with PHPCR ODM but didn’t know how to extend it to support PHPCR ODM back then. I went with netvlies DoctrineBridgeBundle instead which worked fine but had a few limitations and was a bit outdated so I started this bundle.

I wouldn’t mind closing this repo and work on gedmo instead. I just have to check it out and talk to @l3pp4rd if he would merge PHPCR support if implemented properly. As described over at #2 I would like to make it work between all the Doctrine data mappers.

Hi @hacfi , I do not mind concerning phpcr odm support in extensions if someone is willing to support it.

If you are willing to add PHPCR ODM support for one or more extensions I will add you to collaborators and you will be able to maintain it properly.

extensions are currently being refactored for version 2.4.0 but it should not be hard to migrate it later if there will be some tests available in 2.3.x version. Ping me about your plans

I never expected to see other people picking up my old code, that was never fully functional :-). I also had had this problem when picking a name, it would be confusing to others having 2 DoctrineBridge bundles, that would feel kind of redundant. So I thought about ORMPHPCRBridge, because it only focusses on a bridge between ORM and PHPCR ( in which PHPCR is a kind of ODM with some extras).

On the other hadn ORMPHCR or maybe ORMODM is kind of unreadable beause of excessive use of abbreviation, which makes it a kind of Frankenstein name.

So back to basic, what exactly are we bridgin'? I guess it is always an object and always a model. So I'm thinking of the name "ObjectModelBridge" which can optionally be placed under the Doctrine namespace, and gives some room for bridgin other ODM's (like mongoDB) as well.

altough my previous statement just should be ignored when embedding into gedmo extensions naturally :-)

Just took a brief look at the references code in the extensions lib and I think adding support for phpcr is going to bring some problems. Currently it only supports ORM and MongoDB-ODM the type attribute on the annotations accepts either entity or document which needs to be changed when you add support for different ODM backends like phpcr or couchDB.

Looking at the extensions lib and the features is contains I doubt if it's really the right place for this bridge or references feature. As far as I can see all the other functions add some automated logic to a single class and have no real coherence or relation to each other. The 'DoctrineBridgeBundle' is in my eyes something that solves a very different but common problem. Adding support for more doctrine data mappers is bound to add extra configuration options etc.
Most importantly the code for bridging different doctrine backends should be in one place, whatever is decided on what repository that should be.

yes, I agree, extensions are extensions, not a bridge library. The reference extension will serve as long as there is no better solution available.

I’ll have a closer look in a couple of days. My bundle isn’t very flexible yet either.