[TYPO3-mvc] Libraries in Extbase

Christian Lerrahn (Cerebrum) christian.lerrahn at cerebrum.com.au
Wed Dec 16 04:56:15 CET 2009


Hi Jochen,
On Fri, 11 Dec 2009 09:30:17 +0100
Jochen Rau <jochen.rau at typoplanet.de> wrote:
> schrieb Christian Lerrahn (Cerebrum):
> > I'm thinking of splitting our extension eu_sugarcrm into a library
> > backend and one or more frontends. However, to not have do redo
> > everything again for TYPO3 5, I'd like to use extbase already.
> > Effectively the library will be a SOAP/REST wrapper that talks to
> > the SugarCRM SOAP (or possibly later REST) interface on behalf of
> > the frontend. In essence it is just an abstraction layer. So, maybe
> > from what you suggested, that would be a service then?
> 
> I suggest to write a Tx_Extbase_Peristence_Storage_SoapStorageBackend 
> then. The existing storage backend translates the query coming from a 
> Query object into SQL. The SOAP backend does the same for a SOAP call.
> 
> By now, it is not possible to replace the storage backend easily. But 
> this will be supported in future (did somebody say "Dependency 
> Injection"?). Meanwhile you can implement your code inside a
> 
> class Tx_MyExt_Persistence_SoapRepository extends 
> Tx_Extbase_Persistence_Repository
> 
> and then
> 
> class Tx_MyExt_Domain_Repository_MyFooModelRepository extends 
> Tx_MyExt_Persistence_SoapRepository
> 
> If your implementation works nicely we will copy and paste it into 
> Extbase ;-)

I had a look at the Tx_Extbase_Persistence_Repository class and am
wondering a bit about what exactly you had in mind. Were you suggesting
to overload the methods of the Tx_Extbase_Peristence_Repository object
with low level code? I was thinking about building a storage object
that does the low level stuff and then just having an object for the
higher level stuff. I can't do it any more cleanly without the
dispatcher directly using the alternative backend, right?

Cheers,
Christian


More information about the TYPO3-project-typo3v4mvc mailing list